No use of base object allowed in private inheritance

Viewed 1415

I am using private inheritance, and I am surprised to see that in the derived class use of any base object is not allowed.

class A;
class B : private A;
class C : public B;

C::method_1()
{
    A* a; // Temporary "A" object for local computation
}

This has nothing to do with inheritance. I don't want to access any this->base method!

This configuration provide a C2247 error in Visual Studio (" 'A' not accessible, because 'B' use 'private' to inherit from 'A' ").

2 Answers
Related