Is it dangerous to use both virtual
and override
on a function in C++? Does that open you up for ambiguity with overloading?
Obviously virtual
must be used in the base class and it would be silly to not use override
in the derived class, but is it actually problematic to use virtual
with override
in the derived class?
Trying to determine if this is an issue of style or correctness.
Example:
class Widget {
virtual void transmogrify() = 0;
}
class Gadget : public Widget {
virtual void transmogrify() override {}
}