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

-5

u/[deleted] Apr 24 '26

[removed] — view removed comment

15

u/leguminousCultivator Apr 24 '26

This is an insane take. The overwhelming majority of c++ users are not swapping out virtual functions at runtime.

4

u/Serious-Regular Apr 24 '26

You can compile new code while the current program is already running, load it, hook it in, and viola new behavior.

lol my dude this is literally the expression problem and virtual absolutely does not solve it.