C++ - What is this doing if the constructor is private?

Viewed 456

In the code below, why does the compiler not complain for mClass2?

class CMyClass{
private:
    CMyClass(){}
};

void TestMethod(){
    CMyClass mClass1;   //Fails.
    CMyClass mClass2(); //Works.
}
4 Answers
Related