RAD Studio |  |

E2255: Use :: to take the address of a member function (C++)

If f is a member function of class c, you take its address with the syntax

Copy Code

    &c::f

Note the use of the class type name (not the name of an object) and the :: separating the class name from the function name.

(Member function pointers are not true pointer types, and do not refer to any particular instance of a class.)

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