4 ms·
In practice most of the time you would just write a generic version using one of the other mechanisms. Virtual functions, void* and casting, type ids, or whatev
by Negitivefrags 8y ago
In practice most of the time you would just write a generic version using one of the other mechanisms. Virtual functions, void* and casting, type ids, or whatever.
Just like everything else, it's a time/space tradeoff because it generates less optimal code in exchange for a smaller binary size.
- cbsmith 8y agoThere's actually a pretty well established design pattern about wrapping one of those methods with the template class, thereby allowing type safety checks and such whilst still minimizing bloat.