c++ standard practice: virtual interface classes vs. templates
You’re basically right, dynamic polymorphism (inheritance, virtuals) is generally the right choice when the type should be allowed to change at runtime (for example in plugin architectures). Static polymorphism (templates) is a better choice if the type should only change at compile-time. The only potential downsides to templates are that 1) they generally have to … Read more