Here is a little test program :
#include <iostream>
class Test
{
public:
static void DoCrash(){ std::cout<< "TEST IT!"<< std::endl; }
};
int main()
{
Test k;
k.DoCrash(); // calling a static method like a member method...
std::system( "pause ");
return 0;
}
On VS2008 + SP1 (vc9) it compiles fine : the console just diplay "TEST IT!".
As far as i know, static member methods shouldn't be called on instancied object.
1) Am i wrong? Is this code correct from the standard point of view? 2) If it's correct, why is that? I can't find why it would be allowed, or maybe it's to help using "static or not" method in templates?