Possible Duplicate:
C++ static virtual members?
Can we have a static virtual functions? If not, then WHY?
class X
{
public:
virtual static void fun(){} // Why we cant have static virtual function in C++?
};
No, because it doesn't make any sense in C++.
Virtual functions are invoked when you have a pointer/reference to an instance of a class. Static functions aren't tied to a particular instance, they're tied to a class. C++ doesn't have pointers-to-class, so there is no scenario in which you could invoke a static function virtually.