class TestClass
{
public:
TestClass(int i) { i = i; };
private:
int i;
}
class TestClass2
{
private:
TestClass testClass;
}
Why does the above code compile fine even when we have not provided a default constructor?
Only if someone instantiates TestClass2 elsewhere in the code, do we get a compile error. What is the compiler doing here? Seems strange...
Thanks.