Path: utzoo!attcan!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!att!dptg!ulysses!andante!alice!bs From: bs@alice.UUCP (Bjarne Stroustrup) Newsgroups: comp.lang.c++ Subject: Re: Class scope and virtual functions Summary: it works Message-ID: <10113@alice.UUCP> Date: 10 Nov 89 02:50:08 GMT References: <21847@gryphon.COM> <10935@csli.Stanford.EDU> <1989Nov7.073836.23166@brutus.cs.uiuc.edu> Distribution: na Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 31 > keith@csli.Stanford.EDU (Neil Hunt) writes: > > >In article <21847@gryphon.COM> sarima@gryphon.COM (Stan Friesen) writes: > > >> A simplified example follows: > >>class base { virtual int func(); }; > >>class between: public base { // no redef of func(), so use base::func() }; > >>class derived: public between { int func(); }; > >>int derived::func() { > >> between::func(); // I think this is illegal > >>} > >This is certainly permitted in AT&T cfront 1.2; I have used it in > >several cases. > >It is certainly desirable. > >If it went away in 2.0, that seems like a bug to me! It works - as always. The only thing I see wrong with the (condenced) example is the misuse ofthe // in the second line and the fact that base::func() is private. Fixing that I get this: class base { virtual int func(); }; class between: public base { // no redef of func(), so use base::func() }; class derived: public between { int func(); }; int derived::func() { between::func(); // I think this is illegal } which compiles just fine.