home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18990 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.1 KB  |  29 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!utcsri!geac!censor!animal!ralph
  3. From: ralph@yo_dud.bell.ca (Ralph Doncaster)
  4. Subject: semi-private public methods?
  5. Message-ID: <RALPH.93Jan11143011@yo_dud.bell.ca>
  6. Sender: news@animal.er.bell.ca
  7. Reply-To: ralph@dci.pinetree.org
  8. Organization: /home/yo_dud/ralph/.organization
  9. Distribution: na
  10. Date: Mon, 11 Jan 1993 19:30:11 GMT
  11. Lines: 16
  12.  
  13. I would like to have a class that has some public methods that can
  14. only be used by a certain group of classes.
  15. Lets call this class A, and I want B,C,D &E to be able to use the
  16. public methods on A. (no problem so far)
  17. However, I don't want classes X, Y, &Z to be able to use the methods,
  18. nor any other similar classes added in the future.
  19. I don't want B,C,D &E to access the private data of A, so I can't make
  20. them friend classes.  A,B,C,D, &E aren't in the same heirarchy, so I
  21. can't use inheritance to have a solution to the problem.
  22. What I would like to be able to do is say that the public methods of A
  23. are only public to a certain group of classes, and private to all
  24. others.
  25. Any ideas?
  26.  
  27. post, or reply to ralph@dci.pinetree.org
  28.  
  29.