E2235 Member function must be called or its address taken (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Errors And Warnings (C++) Index

A reference to a member function must be called, or its address must be taken with & operator.

In this case, a member function has been used in an illegal context.

For example:

class A
{
   typedef int (A::* infptr)(void);
public:
   A();
   int myex(void);
   int three;
} a;
A::A()
{
   infptr one = myex;       //illegal - call myex or take address?
   infptr two = &A::myex;   //correct
   three = (a.*one)() + (a.*two)();
}