473,382 Members | 1,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

error related to pointer to member function

while compiling getting following error

" cannot convert DBRT_dbrefbag<pdmobject> (*)[1]' toDBRT_dbrefbag pdmtreenode::*)[1]' in initialization

"
Apr 17 '12 #1
3 1523
weaknessforcats
9,208 Expert Mod 8TB
There's not enough information here to answer your question.

It's odd though that you need a pointer to a class member since that violates both encapsulation and data hiding.

You will need to post the line with the problem and the class declarations of the classes involved.
Apr 17 '12 #2
while compiling getting following error

cannot convert `DBRT_dbrefbag<pdmobject> (*)[1]' to `DBRT_dbrefbag<pdmobject> pdmtreenode::*)[1]' in initialization



part of code

"
static DBRT_RefBagHelper< pdmtreenode* , pdmobject* > const
the_pdmtreenode_myobjects_pdmobject_myowner_BagHel per
= { &pdmtreenode::myobjects, &pdmobject::myowner };

"
Apr 18 '12 #3
weaknessforcats
9,208 Expert Mod 8TB
static DBRT_RefBagHelper< pdmtreenode* , pdmobject* > const
the_pdmtreenode_myobjects_pdmobject_myowner_BagHel per
= { &pdmtreenode::myobjects, &pdmobject::myowner };

This template DBRT_RefBagHelper is being paramterized with a dmtreenode* and a dmobject* but you are not providing these addresses. Instead you are trying to use the address of a member variable (myobjects) from a class declaration. pdmtreenode::myobjects does not exist until you create a dmtreenode object. Then you access the member myobjcts by using a member function of dmtreenode.
Apr 18 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: jon wayne | last post by:
Hi I'm a little confused here about the lifetime of a static pointer to member function, Say, I declare,define & initialize a static ptr to mem function in the header file of a class(the class...
4
by: Aaron Walker | last post by:
Greetings, I'm attempting to write my first *real* template function that also deals with a map of strings to member function pointers that is making the syntax a little tricky to get right. ...
6
by: Bill Rubin | last post by:
The following code snippet shows that VC++ 7.1 correctly compiles a static member function invocation from an Unrelated class, since this static member function is public. I expected to compile the...
11
by: Marco Wedekind | last post by:
Hello all, I have a strange compiler behaviour with this code: ---- Begin of code snippet ---- class Base { public: static unsigned int ClassId();
1
by: bjean | last post by:
i have defficulties in coding what is the appropriate code
2
by: Elliott | last post by:
Hello Everyone, I have a function in a header (KeyDialog.h) as such: void setKey(Key&); The function implementation is as such (KeyDialog.cpp): void KeyDialog::setKey(Key& k1) {
2
by: chobblars87 | last post by:
Hi guys. Haven't done C++ in a while and I've never been great with classes but I'm trying to make a compiler using Lex/Yacc. I've sorted most of the errors, all apart two which are both overloaded...
1
by: sunil | last post by:
Hello, I have a template class as follows which has a static function called foo, as you see below the class declaration, there are specializations for foo for different specializations of T, the...
4
by: Immortal_Nephi | last post by:
I had a lot of research to see how function pointer works. Sometimes, programmers choose switch keyword and function in each case block can be called. Sometimes, they choose ordinary function...
2
by: addison5390 | last post by:
So, below is code for a binary tree, the structure is referred to as TreeNode. I'm having some trouble separating what information goes into the TreeNode.h file and the TreeNode.cpp file. Here is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.