WolfireGames / overgrowth

Open Source codebase of the game Overgrowth by Wolfire Games LLC
Apache License 2.0
2.51k stars 260 forks source link

Use override keyword where applicable #62

Closed feliwir closed 2 years ago

feliwir commented 2 years ago

The override keyword was introduced in C++11 and allows to get compilation errors when a function does not override something from the base class. See https://en.cppreference.com/w/cpp/keyword/override

autious commented 2 years ago

Does the removal of the virtual keyword replacing it with override mean it'll still be in the vtable in case of polymorphism?

feliwir commented 2 years ago

Yes, it should still be inside the vtable. There's also the new final keyword in C++11, which will impact how the vtable is generated (allowing for more optimizations). However we don't use that yet