🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++
Article #437

multiple inheritance

#437
From: Michael Tiemann
Date: Sun, 14 May 1989 06:23
33 lines
1559 bytes
You have to be a little more careful when diagnosing MI problems.
Doug Schmidt's posing is preceded by '>'.  Daniel's is preceded by '+'

   >  class a {
   >  public:
   >    int foo () { printf ("foo\n"); }
   >  };
   >  class b : public a {
   >  private:
   >    a::foo; // made private for all classes derived from class b.
   >  };
     
   >  class c : public a {
   >  public:
   >    c () {printf ("c\n");}
   >  };
     
   >  class d : public c, public b {
   >  public:
   >                    // both public *and* private!! which prevails?
   >    d () { printf ("d\n"); foo (); } 
   >  };
   
   ++ My understanding is that if the call is ambiguous it's a
   ++ syntax error. That might not apply in this case since this is 
   ++ the same function being inherited along two different paths of 
   ++ the DAG.
Since this is a case of `independent' multiple inheritance, `foo' is
provided by independent baseclasses, namely c::a::foo and b::a::foo.
GNU C++ observes that as an ambiguity, independent of the visibility
issue, and trudges on.

Michael
Technical Details
Message-ID: <8905140623.AA22716@yahi.stanford.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!YAHI.STANFORD.EDU!tiemann
References: <7105@saturn.ucsc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!YAHI.STANFORD.EDU!tiemann
From: tiemann@YAHI.STANFORD.EDU (Michael Tiemann)
Newsgroups: gnu.g++
Subject: multiple inheritance
Message-ID: <8905140623.AA22716@yahi.stanford.edu>
Date: 14 May 89 06:23:59 GMT
References: <7105@saturn.ucsc.edu>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: tiemann@lurch.stanford.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 33