From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1592759aa83d0d45 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-30 08:02:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!nntp4.savvis.net!uunet!dfw.uu.net!dca.uu.net!ash.uu.net!spool0902.news.uu.net!not-for-mail Date: Fri, 30 May 2003 11:02:19 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030529 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: MI in Ada 200X References: <0Pxza.699607$OV.652508@rwcrnsc54> <4a4de33a.0305280557.5d5aba37@posting.google.com> <1054299592.913465@master.nyc.kbcfp.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1054306939.641448@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1054306939 15242 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:38104 Date: 2003-05-30T11:02:19-04:00 List-Id: Georg Bauhaus wrote: > int B::bar() { foo(); } // which foo() here? Neither one, since it's ambiguous, and the compiler will tell you that. But so what? If you really want to call one of them, you just say which one: int B::bar() { A2::foo(); } If you need to disambiguate the two for further inheritance, you rename and forward: struct A1_r : public A1 { virtual int foo_A1() { return A1::foo(); } int foo() { return foo_A1(); } }; struct A2_r : public A2 { virtual int foo_A2() { return A2::foo(); } int foo() { return foo_A2(); } }; struct B : A1_r, A2_r { int foo_A1(); // override A1's foo int foo_A2(); // override A2's foo };