vendredi 29 juillet 2016

What is the opposite of c++ `override` / `final` modifier?

  • In c++11 the override modifier protects from not overriding an intended virtual base function (because the signatures do not match).
  • The final modifier protects from unintentionally overriding a function in a derived class.

=> Is there a modifier (something like maybe first or no_override) that protects from overriding an unknown base function?

I'd like to get a compiler error when a virtual function was added to a base class with the same signature as an already existing virtual function in a derived class.

Aucun commentaire:

Enregistrer un commentaire