This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
RE: Nested friend classes don't have access
- To: <egcs-bugs at cygnus dot com>
- Subject: RE: Nested friend classes don't have access
- From: "Bruce Eckel" <Bruce at EckelObjects dot com>
- Date: Tue, 12 Jan 1999 06:45:27 -0800
- Reply-To: "Bruce Eckel" <Bruce at EckelObjects dot com>
I figured it out. Sorry about that.
class C {
int i;
public:
C(int ii) : i(ii), d(this) {}
class D;
friend class C::D;
class D {
C* c;
public:
D(C* cc) : c(cc) {}
int f() { return c->i; }
} d;
};
=============================
Bruce Eckel http://www.BruceEckel.com
Contains free electronic books: "Thinking in Java" & "Thinking in C++ 2e"