From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_05,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7251fa99aab97e06 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1993-03-16 00:56:39 PST Path: sparky!uunet!usc!howland.reston.ans.net!spool.mu.edu!yale.edu!ira.uka.de!scsing.switch.ch!sicsun!disuns2.epfl.ch!lglsun!magnus From: magnus@lglsun.epfl.ch (Magnus Kempe) Newsgroups: comp.lang.ada Subject: Re: Encapsulation in Ada vs. C++ (Was Re: Ichibah [sic] ...) Message-ID: <1993Mar16.083809@lglsun.epfl.ch> Date: 16 Mar 93 07:51:07 GMT References: <1993Mar7.191557.5547@evb.com> <1993Mar8.153639.3603@inmet.camb.inmet.com> <1993Mar9.181231.27197@intellistor.com> <1993Mar11.082214@lglsun.epfl.ch> <1993Mar16.063423.4679@lth.se> Organization: Ecole Polytechnique Federale de Lausanne NNTP-Posting-Host: lglsun4.epfl.ch Date: 1993-03-16T07:51:07+00:00 List-Id: 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