r/cpp • u/david-alvarez-rosa • Apr 23 '26
Devirtualization and Static Polymorphism
https://david.alvarezrosa.com/posts/devirtualization-and-static-polymorphism/
81
Upvotes
r/cpp • u/david-alvarez-rosa • Apr 23 '26
View all comments
3
u/SyntheticDuckFlavour Apr 24 '26
My only criticism of static polymorphism is that base class always needs to know about the concrete definition of the derived class in some capacity. So with the example given above, this is not possible: