From -4491555556645622578 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,edd477ec92e5348f X-Google-Attributes: gidf78e5,public X-Google-Thread: fc772,ef0c226459c03bdf X-Google-Attributes: gidfc772,public From: Valentin Bonnard Subject: Re: Protected Inheritance Date: 1999/02/06 Message-ID: <36BBB582.63DC@clipper.ens.fr>#1/1 X-Deja-AN: 441528561 Approved: hsutter@peerdirect.com Sender: cppmods@netlab.cs.rpi.edu References: <79aesq$qlr$1@uuneo.neosoft.com> X-Submission-Address: c++-submit@netlab.cs.rpi.edu X-Approved-For-Group: Fergus Henderson comp.std.c++ X-Original-Date: 07 Feb 99 00:15:55 GMT Organization: Ecole Normale Superieure, Paris, France X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated iQBVAwUANrzwikHMCo9UcraBAQGH5gIAmlrARDaYqiOK2EzDZhTZd2E0was2NmPx U9D8fQ0J1iMXQEwXNnFjMf5YqEPZLktPyyPp7RFFNX85NWTcIA4ssw== =6Flv Newsgroups: comp.lang.c++.moderated,comp.std.c++ Scott Meyers wrote: > This might be a reasonable example, but I'm not convinced C++ works the > way > you describe. In particular, I don't think further derivation is > supposed > to be prohibited by the use of private virtual inheritance. I fed this > to > VC6: > > class Base { > public: > Base(); > }; > > class Derived: private virtual Base {}; > > class MoreDerived: public Derived {}; > > MoreDerived m; > > It took it without complaint. Since we all know VC6 is a perfect > compiler, this should settle the matter. Well, actually no, MSVC is wrong here. Base is private to Derived and thus inaccessible in MoreDerived. However, this is trivial to work-arround: class MoreDerived: public Derived, virtual Base {}; is valid. -- Valentin Bonnard --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]