home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13024 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.0 KB  |  30 lines

  1. Path: sparky!uunet!gatech!purdue!yuma!csn!evolving.com!jcm
  2. From: jcm@evolving.com (Jack Morrison)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Inherited nested classes?
  5. Message-ID: <1992Aug28.164813.51739@evolving.com>
  6. Date: 28 Aug 92 16:48:13 GMT
  7. References: <GIROD.92Aug25095844@node_262d6.tele.nokia.fi>
  8. Organization: Evolving Systems, Inc.
  9. Lines: 19
  10.  
  11. I've just run into what I think is a related problem, but maybe a bit simpler.
  12. Here's the stripped-down code:
  13.  
  14.     class C {
  15.     private:
  16.         struct A { int x; };
  17.         struct B { A a1; };
  18.         A a2;
  19.     };
  20.  
  21. The AIX 3.2 xlC compiler complains about the struct B declaration, saying
  22. it can't access private type C::A. I guess I understand this, since B is
  23. basically a (nested) class. Making A protected doesn't seem to help, which
  24. apparently means B is not a subclass of C. Making A *public* works, but I 
  25. didn't really want to bother anyone outside the class with the struct type.
  26.  
  27. -- 
  28. "How am I typing?  Call 1-303-969-3354"    jcm@evolving.com
  29. Jack C. Morrison, Evolving Systems, Inc. Lakewood, Colorado
  30.