home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13107 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.2 KB

  1. Path: sparky!uunet!olivea!decwrl!borland.com!pete
  2. From: pete@genghis.borland.com (Pete Becker)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Inherited nested classes?
  5. Message-ID: <1992Aug31.180702.29843@genghis.borland.com>
  6. Date: 31 Aug 92 18:07:02 GMT
  7. References: <1992Aug29.160423.16617@genghis.borland.com> <4902@holden.lulea.trab.se> <1894@acf5.NYU.EDU>
  8. Sender: news@borland.com (News Admin)
  9. Organization: Borland International
  10. Lines: 28
  11. Originator: pete@genghis.borland.com
  12.  
  13. In article <1894@acf5.NYU.EDU> checker@acf5.NYU.EDU (checker) writes:
  14. >jbn@lulea.trab.se (Johan Bengtsson) writes:
  15. >>Are private nested types useful at all, given the current language definition?
  16. >
  17. >Huh?  How else would you have the access control work?  Of course they
  18. >are useful:
  19. >
  20. >class list
  21. >{
  22. >public:
  23. >    // ...
  24. >private:
  25. >    class list_node
  26. >    {
  27. >        // ...
  28. >    }
  29. >
  30. >    list_node *pHead;
  31. >};
  32. >
  33. >Chris
  34.  
  35.     This example omits the most interesting part: members of list_node that
  36. try to use the name 'list_node'.  Since it's private in list, and list_node is
  37. not a member function of list, members of list_node cannot access the name
  38. list_node.  Which makes almnost all useful code illegal.  But that's clearly
  39. a flaw in the wording, and not the intention of the language.
  40.     -- Pete 
  41.