Skip to content

Conversation

roidanton
Copy link

Did not use final b/c being not sure if these classes are ought to be subclassed by consumers.

@AntonioNoack
Copy link

Didn't you just move the override keyword from the front of a function farther towards the end of its head?

@roidanton
Copy link
Author

roidanton commented Jun 28, 2022

No.
Having the override (or final) keyword in place enables a compile time check if the derived function signature exists in the base class. Using virtual on an already virtual function is meaningless and doesn't provide any compile time protection -> in case the function signature between a derived and the base class changes. the compiler wouldn't recognize and just add an additional function then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants