I'm using Visual C++, If I compile this code:
class A {};
class B : private A {};
class C : public B
{
void func()
{
A a{};
}
};
I get this error:
error C2247: 'A' not accessible because 'B' uses 'private' to inherit from 'A'
I know that if I use private inheritance, Then the members of the class 'A' would be private in 'B', And inaccessible in 'C', But why can't I create an object of 'A' inside 'C'?