This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Compilation error while return function pointers


Hi Purnendu,

A pointer to a function is different from a pointer to a member function.

The member function has an implicit "this" pointer.

Because of that difference, the types are not the same.

One way to correct the problem that the compiler has identified is to change your member_test1 to be a class function by annotating it with the static keyword.  Depending on what you are trying to do, that may-or-may-not be something that would work.  Hard to tell, since your code example as given is not compilable.

HTH,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]