In fact, you do not need to do anything special.
By default, the implementation of XVec2 position() const
in XLightSprite
will hide the position()
of XSprite
and will act as an override of the virtual function defined in XLightSource
.
If, however, you want to clarify that your intention is to override the function, you can add a declaration of use
class XLightSprite : public XSprite, public XILightSource { public: using XSprite::position; XVec2 position() const; };
Note that if position () from XSprite is also a virtual function in the same format, the new implementation will also act as an override of position in XSprite.
source share