I have a derived class inheriting from both an interface and a base class. The interface defines a virtual function GetId
, which is implemented in the other base class.
class ITestClient
{
public:
virtual int GetId() = 0;
};
class BaseClient
{
public:
int GetId();
}
int BaseClient::GetId()
{
return 10;
}
class TestClient : public ITestClient, public BaseClient {
};
I get unimplemented pure virtual method 'GetId'
. So I could do this to fix the compile error...
class TestClient : public ITestClient, public BaseClient {
int GetId()
{
return BaseClient::GetId();
}
};
Why isn't the base class BaseClient
's concrete function definition of GetId
sufficient as an implementation of the interface's virtual function?