Re:Programming Your Own Language in C++
by clappski on Monday August 08, 2016 @04:04AM
(#12246143)
Which would introduce the overhead of a vtable, which would vary depending on how deep your inheritance goes. I haven't read the article, but I would maybe use an enum if this is just use to parse variable declarations.
[ Parent
| on HN ]
Re:Programming Your Own Language in C++
by beached_whale on Sunday August 14, 2016 @09:24PM
(#12288102)
Generally the vtable is not much slower. I believe around the cost of an extra pointer derefence vs the alternative of branching. Also the compiler can sometimes optimize the cost to be the same as a normal call(e.g. final)