RAD Studio |  |

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

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:

Copy Code

    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)();
    }

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!