fork download
struct foo {
    int f();
};

int main() {
    void* p = static_cast(&foo::f);
}
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:6: error: invalid static_cast from type ‘int (foo::*)()’ to type ‘void*’
prog.cpp:6: warning: unused variable ‘p’
stdout

Standard output is empty