This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Member class access to private members of enclosing class


>>>>> "Dylan" == Dylan Cuthbert <dylan@q-games.com> writes:

> The way I look at it, is that a class defined within another class is a
> *member* of that class, and as in the case for function members gains access
> to all the private/protected members of the surrounding class.

> G++ (3.1 beta) compiles this with no problems, and I think it should work,
> but I find conflicting information on the web and in "The C++ Programming
> Language 3rd edition".

This was recently changed; nested classes now do have access to their
enclosing classes.  You can find the issue somewhere under

  http://std.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html

if you care.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]