If inherit two abstract classes with a pure virtual method of the same name then what happens if I implement that method? Do I implement them for both abstract classes or does the compiler choose one to implement?
/ConsoleCalc::DataFlow::Main
namespace ConsoleCalc {
namespace DataFlow
{
class Main
{
public:
Main();
virtual ~Main()=0; // exit
virtual int Start() =0;
};
};
};
//ConsoleCalc::UserInterface::Menu
#include <iostream>
namespace ConsoleCalc {
namespace UserInterface
{
class Menu
{
private:
std::string MenuText;
public:
Menu();
virtual ~Menu()=0;
virtual int Start() =0;
};
};
};
//ConsoleCalc::
#include "Main.h"
#include "Menu.h"
namespace ConsoleCalc
{
namespace Application
{
class Application :
public ConsoleCalc::DataFlow::Main,
private ConsoleCalc::UserInterface::Menu
{
public:
Application();
virtual ~Application() =0;
virtual int Start(); //implementation
};
};
};
The method is question is Start
. Is there a way implement both Start methods? Or does one implementation suffice for both? Or does the compiler somehow choose which one gets implemented, possibly throwing out the other?