In my class, If I want to point to a member of class,
struct S
{
static int get();
int do_something();
int x;
};
I do,
int (*p)() = S::get;
Unfortunately this doesn't for non-static member
int (*p)() = S::do_something; // error
Since, a static member function is an ordinary function, and from the quote I came around below states that a non-static member function is also a ordinary function so why wouldn't it work? what does it mean?
(9.2/10) [Note: the type of a nonstatic member function is an ordinary function type, and the type of a nonstatic data member is an ordinary object type. There are no special member function types or data member types. ]