Class A contains the entered name of class A in its scope (that is, A::A belongs to class A , unless this is constructor related).
Class B inherits this, so the name A within region B refers to the entered class A in region A However, since A is a private base class of B , all names in the domain A are private inside B
Class C inherits this again, but it cannot access this A , since it is private within B Hence the error. Note that the error is actually related to using the name A in the B<A> construct.
The class BA does not have this problem, since the definition of B<A> not within the scope of any class, therefore the name A refers to the global name A , and not to any class-name entered. And, of course, the name BA is publicly available.
You can easily solve this by assigning the name A to C :
class C : public B<A> { public: C() : B<::A>( 123 ) {} };
Note that constructor inheritance is not valid. The problem is access to the class name A (entered in A and inherited in B and C ), and not access to the constructor.
Angew Aug 23 '16 at 13:07 on 2016-08-23 13:07
source share