Article View: comp.std.c++
Article #1023Pure functions and derived classes
From: richard henderson~
Date: Thu, 18 Apr 1991 23:37
Date: Thu, 18 Apr 1991 23:37
38 lines
1227 bytes
1227 bytes
In the following construction:
struct Base
{
virtual int func_a() = 0;
virtual int func_b() = 0;
virtual int func_c() = 0;
};
struct Mid_a : virtual public Base
{
virtual int func_a();
virtual int func_b() = 0;
virtual int func_c() = 0;
};
struct Mid_b : virtual public Base
{
virtual int func_a() = 0;
virtual int func_b();
virtual int func_c() = 0;
};
struct Der : public Mid_a, public Mid_b
{
virtual int func_c();
};
both BC++ and g++ complain that the pure functions Mid_a::func_b() and
Mid_b::func_a() are not overridden.
What is the proper way to declare this construction? It seemed to me
that Mid_a::func_a() should override Mid_b::func_a() and vice-versa.
thanks in advance,
richard~
st12a@menudo.uh.edu
richard@stat.tamu.edu
Technical Details
Message-ID:
<1991Apr18.233753.26738@menudo.uh.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!st12aShow Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!st12a From: st12a@menudo.uh.edu (richard henderson~) Subject: Pure functions and derived classes Message-ID: <1991Apr18.233753.26738@menudo.uh.edu> Keywords: Pure functions Sender: st12a@menudo.uh.edu (richard henderson~) Organization: University of Houston Date: Thu, 18 Apr 1991 23:37:53 GMT