r/cpp • • Apr 23 '26

Devirtualization and Static Polymorphism

https://david.alvarezrosa.com/posts/devirtualization-and-static-polymorphism/
81 Upvotes

36 comments sorted by

View all comments

Show parent comment

2

u/Potterrrrrrrr Apr 24 '26

You can also slap it on the class definition itself which is useful for preventing accidental inheritance of that class too, I quite like that.