Business man analyzing a graph on a laptop

C++ Templates with Virtual Functions?

C++ offers two forms of polymorphism: virtual functions and overrides / implementations, and templates. There can be cases when it makes the most sense to essentially have both. You can’t do this though.  C++ expressly forbids virtual template functions because the virtual tables that would have to be built are way too complex. Luckily, C++ offers a way around this. It’s a programming paradigm called Policy Based Design. In this article, I’ll cover why you might need this, and how it works.

Read More