Article View: comp.std.c++
Article #2941Encapsulation and friends
From: Anders Eklund
Date: Thu, 14 Dec 1995 20:18
Date: Thu, 14 Dec 1995 20:18
31 lines
1505 bytes
1505 bytes
Friends break the rules of encapsulation and should be avoided
as much as possible, but sometimes they must be used anyway.
When I have used friends they only had to use one or a
few members of the class. As it is now all members are
accessible to the friend. I would like to specify which members
the friend can access. There is no way to do that today, but
would it not be nice to be able to do so? Any comments?
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
___
/ / /
/__ /___ ___/___ ___ ___ -- Anders Eklund anders@ida.his.se --
/ // // //__// /__ -- Computer Science Department --
_/ // //__//__ / ___/ -- University of Skovde, Sweden --
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<4apdff$eos@mhost.ida.his.se>Path:
arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!mattShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!matt From: anders@ida.his.se (Anders Eklund) Newsgroups: comp.std.c++ Subject: Encapsulation and friends Date: 14 Dec 1995 20:18:55 GMT Organization: University of Skoevde Approved: matt@Austern (Matt Austern) Message-ID: <4apdff$eos@mhost.ida.his.se> Reply-To: anders@ida.his.se NNTP-Posting-Host: austern.hip.berkeley.edu