Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!orion.oac.uci.edu!uci-ics!news From: schmidt@zola.ics.uci.edu (Doug Schmidt) Newsgroups: comp.lang.c++ Subject: Inheritance and static member functions Message-ID: <1989Oct13.055104.21637@paris.ics.uci.edu> Date: 13 Oct 89 05:51:04 GMT Sender: news@paris.ics.uci.edu (Network News) Reply-To: schmidt@zola.ics.uci.edu (Doug Schmidt) Organization: University of California, Irvine - Dept of ICS Lines: 43 The following code illustrates an interesting situation arising from the combination of inheritance and static member functions. ---------------------------------------- class foo { public: foo (); static int foobar (); }; class bar : private foo { public: bar (); }; class baz : private bar { public: baz () { // Is this call legal? In one sense it is illegal (if you follow // the inheritance hierarchy). However, from another perspective // foo::foobar () is a call to a static member function that is // visible in the public section of class foo. foo::foobar (); } }; ---------------------------------------- Does cfront 2.0 `do the right thing' here, i.e., does it conform to the language definition? thanks, Doug -- Master Swordsman speak of humility; | schmidt@ics.uci.edu (ARPA) Philosophers speak of truth; | office: (714) 856-4034 Saints and wisemen speak of the Tao of no doubt; The moon, sun, and sea speaks for itself. -- Hiroshi Hamada