This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Member class access to private members of enclosing class
- From: Jason Merrill <jason at redhat dot com>
- To: "Dylan Cuthbert" <dylan at q-games dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 02 May 2002 13:56:52 +0100
- Subject: Re: Member class access to private members of enclosing class
- References: <004701c1f0bf$07e5b940$2801a8c0@dcuthbert2k>
>>>>> "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