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