C
cppsks
Consider the following:
class BaseInterface
{
public:
virtual void something() = 0;
};
class AbstractSubclass : public BaseInterface
{
public:
virtual void somethingElse() = 0;
virtual void something() = 0; // is this declaration preferred or not?
};
First of all, I am "assuming" (since I don't know for sure) if the
declaration of pure virtual "something" method in AbstractSubclass won't
hide the one in BaseInterface. If it doesn't hide, then is this
redeclaration preferred since the subclasses of AbstractSubclass can see
this and implement it or is it better it leave it alone, meaning declare it
in BaseInterface only?
Thanks.
class BaseInterface
{
public:
virtual void something() = 0;
};
class AbstractSubclass : public BaseInterface
{
public:
virtual void somethingElse() = 0;
virtual void something() = 0; // is this declaration preferred or not?
};
First of all, I am "assuming" (since I don't know for sure) if the
declaration of pure virtual "something" method in AbstractSubclass won't
hide the one in BaseInterface. If it doesn't hide, then is this
redeclaration preferred since the subclasses of AbstractSubclass can see
this and implement it or is it better it leave it alone, meaning declare it
in BaseInterface only?
Thanks.