Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!axion!micromuse!peter From: peter@micromuse.co.uk (Peter Galbavy) Newsgroups: comp.lang.c++ Subject: Re: Derived* -> Base* conversion under public/private MI Message-ID: <1991Feb13.085612.19613@micromuse.co.uk> Date: 13 Feb 91 08:56:12 GMT References: <64530@brunix.UUCP> Organization: Same Planet, Different World, London Lines: 49 In article <64530@brunix.UUCP> sdm@cs.brown.edu (Scott Meyers) writes: > >The ARM says (p. 36) > > A pointer to a class may be converted to a pointer to an accessible > base class of that class provided the conversion is unambiguous; a > base class is accessible if its public members are accessible. > >This doesn't help much. In the above example, Base's public members are >accessible through one path, inaccessible through the other. Because Base >is a virtual base class, ambiguity is not a problem here. > I hope I am getting this right - but also the ARM says on page 117 (in the UK at least - page 36 matches): ---- BOT ---- 11.7 Multiple Access If a name can be reached by several paths through a multiple inheritance graph, the access is that of the path that gives most access. For example, class W { public: void f(); }; class A : private virtual W { }; class B : public virtual W { }; class C : public A, public B { void f() { W::f(); } // ok }; Since W::f() is available to C::f() along the public path through B, access is legal. ---- EOT ---- All typos are mine ---- I hope that is the right answer to the right question :-) I am still VERY new to C++ (as far as I am concerned anyway). On another point - can anyone recommmend a good (up to date) book along the lines of C++ for C hackers ? I do not want C++ from first principals, what I need is a book that will enlighten me in certain areas, and leave my misconceptions alone in others :-> Regards, -- Peter Galbavy Writing at Home, but working for Micromuse Ltd, who don't even know I am posting, and probably don't care, so this ain't nothing to do with them... But if you must, call me daytime on +44 71 352 7774. **BEEP**