This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: Type access control -- now too strict
> > > Apparently it's now impossible to define static data of private type
> > > if that private type has a constructor.
> > > class B { B(int) {} };
> > [snip]
> > > A::B A::b(1);
> >
> > Particularly when the type's constructor is private :-)
>
> Ah, but that should work anyway, because A is an implicit friend of B.
It isn't. In standard C++, neither class is friend of the other.
According to Core Issue 45
# A member class should have access to the members of the enclosing
# class in the same manner as if it had been declared a friend of the
# enclosing class.
So B is implicit friend of A, but not vice versa.
Regards,
Martin