C++ multiple inheritance function call ambiguity
Sure!
a.base1::start();
or
a.base2::start();
a.base1::start();
a.base2::start();
or if you want to use one specifically
class derived:public base1,public base2
{
public:
using base1::start;
};
In addition to the answers above, if we are in the case of NON-VIRTUAL inheritance:
you can:
- use
static_cast<base1*>(a).start()
or
- override start() in derived
Btw - please note the diamond problem that can appear. In this case you might want to use virtual.