Re:Overriding C++ virtual functions at run time
by topiolli on Sunday August 09, 2020 @06:15AM
(#24098549)
Cool. Is this due to "final" and the fact that the compiler can figure out the target at compile time?
[ Parent
| on HN ]
Re:Overriding C++ virtual functions at run time
by MaulingMonkey on Sunday August 09, 2020 @09:33AM
(#24099529)
One call site (the one that takes bar&) relies on the final to devirtualize. The other call sites merely rely on the compiler being able to determine the exact type involved at compile time to devirtualize.