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.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,169758d7f087ac5b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-06 09:21:05 PST Path: nntp.gmd.de!Germany.EU.net!EU.net!howland.reston.ans.net!news2.near.net!news.mathworks.com!uhog.mit.edu!news.mtholyoke.edu!news.umass.edu!nic.umass.edu!twain.ucs.umass.edu!yang From: yang@twain.ucs.umass.edu (Huayong YANG) Newsgroups: comp.lang.ada Subject: Re: C++ Envy Date: 6 Jan 1995 17:21:05 GMT Organization: University of Massachusetts, Amherst Message-ID: <3eju61$3kn@nic.umass.edu> References: <3eh9ak$q3g@Starbase.NeoSoft.COM> Reply-To: yang@titan.ucs.umass.edu NNTP-Posting-Host: twain.ucs.umass.edu X-Newsreader: TIN [version 1.2 PL2] Date: 1995-01-06T17:21:05+00:00 List-Id: SBS Engineering (progers@Starbase.NeoSoft.COM) wrote: > Tired of hearing about all those things that C++ can do that Ada87 can't? > Then here's a cute trick in C++ that you'll like: > #define private public > #include compromised_class.h > #define private private > Confused? The above says that when compiling the class header for > compromised_class, all the private stuff will be public, and thus > available to the world. A friend showed me the above, and quoted the > source as saying that eternal damnation was insufficient punishment... > Hard to argue with. Tell me how the above trick compromises the following class: class T { int an_item; public: int another; }; The data member an_item stays private, it seems to me. -- Huayong