🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3322

Re: Anyone considered inheritable friendship?

#3322
From: Steve Clamage
Date: Mon, 12 Feb 1996 18:24
30 lines
2211 bytes
In article AFVop7nqs7@qsar.chem.msu.su, "Eugene Radchenko" <eugene@qsar.chem.msu.su> writes:

>Has anyone proposed/considered the inheritable friendship in addition to
>the current one? Suppose the following design (non-template version for
>brevity): ...

>I think we should allow inheritable friendship (probably in addition to
>current non-inheritable one). Anyway, we are not creating the Pentagon
>security system and thus should not be much afraid of deriving Spy from
>TrustedUser. Especially considering that otherwise all ends in making this
>data public.

I don't see much difference between allowing friendship to be inherited
and making all class members public. The purpose of access control is
not to hide implementation details from other programmers, because it
does not do that. The purpose is more to prevent other parts of the
program from depending on implementations details as opposed to depending
only on the public interface.

If friendship is inheritable, you cannot know what functions have access to
the implementation details of the class. That means that you cannot change
those details. You might as well make everything public. The effect on
program design and maintenance is comparable.

---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
Technical Details
Message-ID: <4fnrfr$7b1@engnews1.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern
References: <AFVop7nqs7@qsar.chem.msu.su>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern
From: clamage@Eng.Sun.COM (Steve Clamage)
Newsgroups: comp.std.c++
Subject: Re: Anyone considered inheritable friendship?
Date: 12 Feb 1996 10:24:02 PST
Organization: Sun Microsystems Inc.
Approved: austern@isolde.mti.sgi.com
Message-ID: <4fnrfr$7b1@engnews1.Eng.Sun.COM>
References: <AFVop7nqs7@qsar.chem.msu.su>
Reply-To: clamage@Eng.Sun.COM
NNTP-Posting-Host: isolde.mti.sgi.com
X-Original-Date: 12 Feb 1996 16:56:27 GMT
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBVAwUBMR+F0Ey4NqrwXLNJAQGqkgIAvcNoGPIkY/8JokWK7zbcJsmq8+wAt+EU
 zB/6cC+8XW+wL5sDL+Q9yDJUllupZnqnslsw+OnAT5b4oTq9e5OkRw==
 =LI4R
Originator: austern@isolde.mti.sgi.com