Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!samsung!uunet!pdn!tscs!tct!chip From: chip@tct.uucp (Chip Salzenberg) Newsgroups: comp.lang.c++ Subject: Re: Derived can't access protected members of base's Message-ID: <260904D1.6918@tct.uucp> Date: 22 Mar 90 17:01:05 GMT References: <56.UUL1.3#5109@pantor.UUCP> <10593@alice.UUCP> Organization: ComDev/TCT, Sarasota, FL Lines: 17 According to ark@alice.UUCP (Andrew Koenig): > class Foo { > protected: > int i; > }; > > class dummy: public Foo { friend void clobber(Foo&, int); }; > >Now `dummy' can get at any protected member of Foo, and so can its >friends. By making `clobber' a friend, I open Foo up to it, and >completely without permission from the author of Foo. I wouldn't say "completely without permission." The author of Foo did, after all, mark "i" as "protected" instead of "private." -- Chip Salzenberg at ComDev/TCT , "The Usenet, in a very real sense, does not exist."