logoalt Hacker News

jstimpflelast Sunday at 9:34 PM1 replyview on HN

1. No, you're not writing code you don't have to. It's not different to implementing this as non-virtual methods, in fact I'd argue doing simple functions is more straightforward.

2. And the code being compiled is abstract & generic, it won't be instantiated for every type and bloat the executable or instruction cache.

3. Security concerns: With C++ virtual methods every object carries a mutable pointer too (to a vtable containing function pointers). What resource management side effects please?


Replies

kllrnohjyesterday at 3:05 AM

Re #3: vtable pointers aren't mutable...?

show 1 reply