mardi 2 mai 2017

Is there a way to mark a parent's virtual function final from a child class without reimplementing it

If I have the code:

struct Parent
{
    virtual void fn();
};

struct Child : public Parent
{
    virtual void fn() override final
    {
        Parent::fn();
    }
};

is there a way to have Child::fn be final without reimplementing it?

like:

struct Child : public Parent
{
    virtual void fn() override final = Parent::fn;
};

or some other syntax?

Aucun commentaire:

Enregistrer un commentaire