lundi 13 mars 2017

Make virtual function final without giving new definition

In my class hierarchy there are numerous virtual functions that can be overridden. My Window class for example has many functions that don't need to be changed but should also not be overridden in the future. So I want to add the final keyword to some of Window's functions, but I don't need to redefine any of them because they already work like I want them to.

I'm currently just calling the base class function in the final redefinition but I'm wondering if there's a better way to do this that doesn't require even doing that.

Aucun commentaire:

Enregistrer un commentaire