J
John
I'm inheriting from multiple abstract base classes (2 to be exact).
In the inherited class I want to know if I can implement two pure
virtual methods (one from each base class) having the same name?
An example is worth a thousand words (Note: I didn't check syntax but
you will get this gist of it), so here it is ....
class Base1
{
virtual void action() = 0;
};
class Base2
{
virtual void action() = 0;
};
class Derived : public Base1, public Base2
{
/*How the heck do I implement both inherited "action" methods? I filled
in an idea here that I'm working on, but cannot seem to get it to
compile ...
*/
Base1::action() { /* do stuff */; } // does not work
Base2::action() { /* do stuff */; } // ditto
};
???
Thanks.
--John
In the inherited class I want to know if I can implement two pure
virtual methods (one from each base class) having the same name?
An example is worth a thousand words (Note: I didn't check syntax but
you will get this gist of it), so here it is ....
class Base1
{
virtual void action() = 0;
};
class Base2
{
virtual void action() = 0;
};
class Derived : public Base1, public Base2
{
/*How the heck do I implement both inherited "action" methods? I filled
in an idea here that I'm working on, but cannot seem to get it to
compile ...
*/
Base1::action() { /* do stuff */; } // does not work
Base2::action() { /* do stuff */; } // ditto
};
???
Thanks.
--John