home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 19005 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  925 b 

  1. Path: sparky!uunet!think.com!barmar
  2. From: barmar@think.com (Barry Margolin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: semi-private public methods?
  5. Date: 12 Jan 1993 15:48:01 GMT
  6. Organization: Thinking Machines Corporation, Cambridge MA, USA
  7. Lines: 13
  8. Distribution: na
  9. Message-ID: <1iup7hINNi01@early-bird.think.com>
  10. References: <RALPH.93Jan11143011@yo_dud.bell.ca>
  11. NNTP-Posting-Host: telecaster.think.com
  12.  
  13. In article <RALPH.93Jan11143011@yo_dud.bell.ca> ralph@dci.pinetree.org writes:
  14. >Lets call this class A, and I want B,C,D &E to be able to use the
  15. >public methods on A. (no problem so far)
  16. >I don't want B,C,D &E to access the private data of A, so I can't make
  17. >them friend classes.
  18.  
  19. Make the methods protected, and define a derived class Aprime that inherits
  20. from A.  Make B, C, D, and E friends of Aprime.
  21. -- 
  22. Barry Margolin
  23. System Manager, Thinking Machines Corp.
  24.  
  25. barmar@think.com          {uunet,harvard}!think!barmar
  26.