From: magnus@lglsun.epfl.ch (Magnus Kempe)
Subject: Re: Encapsulation in Ada vs. C++ (Was Re: Ichibah [sic] ...)
Date: 16 Mar 93 07:51:07 GMT
Date: 1993-03-16T07:51:07+00:00 [thread overview]
Message-ID: <1993Mar16.083809@lglsun.epfl.ch> (raw)
In-Reply-To: 1993Mar16.063423.4679@lth.se
dag@control.lth.se (Dag Bruck) writes:
: A [C++] class grants friendship to other functions or classes, which means
: that the author of a class controls who gets access to the private
: members of the class. You cannot grant yourself access to any random
: class.
If your class Foo grants "friendship" to a function/class Bar, _anyone_
can write such a function/class and, having granted itself "friendliness",
will have access to the internals of Foo.
To repeat: contrary to Ada, C++ does not provide a safe means to create
subprograms acting on parameters of two or more types (classes). In
C++, either you write an unsafe class because the language lacks the
concept of a module, or you twist around with .h files and say good-bye
to limited, separate recompilations.
--
Magnus Kempe "No nation was ever drunk when wine was cheap."
magnus@lglsun.epfl.ch -- Thomas Jefferson
next prev parent reply other threads:[~1993-03-16 7:51 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
1993-03-07 19:15 Ichibah flames, and flames out over, Ada 9X John Goodsen
1993-03-08 0:45 ` David Emery
1993-03-08 15:36 ` Tucker Taft
1993-03-08 16:28 ` Michael Feldman
1993-03-08 22:15 ` Gregory Aharonian
1993-03-09 14:20 ` Tucker Taft
1993-03-09 14:55 ` C. Michael Holloway
1993-03-10 14:51 ` Gregory Aharonian
1993-03-09 17:12 ` Harry Koehnemann
1993-03-09 20:54 ` Michael Feldman
1993-03-09 20:14 ` Larry M. Jordan
1993-03-09 17:49 ` Harry Koehnemann
1993-03-09 21:01 ` Michael Feldman
1993-03-09 18:12 ` Tom Wicklund
1993-03-11 8:04 ` Encapsulation in Ada vs. C++ (Was Re: Ichibah [sic] ...) Magnus Kempe
1993-03-16 6:34 ` Dag Bruck
1993-03-16 7:51 ` Magnus Kempe [this message]
1993-03-16 9:51 ` Dag Bruck
1993-03-09 18:53 ` Ichibah flames, and flames out over, Ada 9X Larry M. Jordan
1993-03-09 20:24 ` David Weller
1993-03-09 21:03 ` Michael Feldman
1993-03-12 14:49 ` Tucker Taft
1993-03-12 23:54 ` Michael Feldman
1993-03-16 17:34 ` Robert Firth
-- strict thread matches above, loose matches on Subject: below --
1993-03-16 22:37 Encapsulation in Ada vs. C++ (Was Re: Ichibah [sic] ...) John Goodsen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox