I have something like this (simplified)
class A { public: virtual void Function () = 0; }; class B { public: virtual void Function () = 0; }; class Impl : public A , public B { public: ???? };
How can I implement function () for A and function () for B? Visual C ++ allows you to define a specific built-in function (i.e. Not in the cpp file), but I assume this is an extension. GCC complains about it. Is there a standard C ++ way to tell the compiler which function I want to override?
(visual C ++ 2008)
class Impl : public A , public B { public: void A::Function () { cout << "A::Function" << endl; } void B::Function () { cout << "B::Function" << endl; } };
Thank!
c ++ override diamond-problem virtual
QbProg Jun 30 '10 at 14:39 2010-06-30 14:39
source share