Compiler Error C2298

'operation' : illegal operation on pointer to member function expression

A pointer to member function expression can only be used to call the member function.

The following is an example of this error:

struct X {
    int mf() { return 0; }
};

X x;
int (X::*pmf)() = &X::mf;

int main()
{
    int (*pf)();
    pf = x.*pmf;   // error
    +(x.*pmf);     // error
    return 0;
}