class A
{
private:
A () {}
public:
static A* getInstance ()
{
return new A ();
}
};
int main ()
{
A.getInstance ();
return 0;
}
results in the error stated in the title. I do realize that if I create a variable in class A and instanciate it there and return it directly, the error will vanish.
But, here I want to understand what is the meaning of this error and why can't I use it this way.