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.8 required=5.0 tests=BAYES_00,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-15 22:51:13 PST Newsgroups: comp.lang.ada Path: sparky!uunet!pipex!sunic!news.lth.se!dag From: dag@control.lth.se (Dag Bruck) Subject: Re: Encapsulation in Ada vs. C++ (Was Re: Ichibah [sic] ...) Message-ID: <1993Mar16.063423.4679@lth.se> Sender: news@lth.se Organization: Department of Automatic Control, Lund, Sweden References: <1993Mar7.191557.5547@evb.com> <1993Mar8.153639.3603@inmet.camb.inmet.com> <1993Mar9.181231.27197@intellistor.com> <1993Mar11.082214@lglsun.epfl.ch> Date: Tue, 16 Mar 1993 06:34:23 GMT Date: 1993-03-16T06:34:23+00:00 List-Id: In magnus@lglsun.epfl.ch (Magnus Kempe) writes: > >To achieve this, operators would have to be "friends" in C++, >because of its equation "module = class"; however, the problem >with such an approach is that _anyone_ can then claim to be a >"friend", and therefore _anyone_ can break the abstraction of >the class. This is incorrect. A 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. -- Dag Bruck