C++ question: staticExpert, i have a question on static.
The partial code is as following:
[quote]
// in a class Object
...
private:
typedef void (Object::*Omf) ();
static Omf farray[3];
...
[/quote]
Here i can't understand why "static" is a must?
I have tried to remove "static" but then i get compilation error message:
menu1.cpp:17: 'void (Object::* Object::farray[3]()' is not a static member of 'class Object'
Here static seems not a lifetime issue. Thanks for you enlightenmen.
my thots
a static member is a class member, while a non-static member is an boject member.
It is hard for the compiler to check validity of the sytax if the member fuction poiter is an object memeber. because the compiler cannot always know the exact memeber function it is pointing to at compile time.
It is hard for the compiler to check validity of the sytax if the member fuction poiter is an object memeber. because the compiler cannot always know the exact memeber function it is pointing to at compile time.