Coming back from our last post about generic flyweights in C++, we can write a flyweight that can be used with any abstract base classes.
Series: Generic Flyweight
The flyweight is a well-known GoF design pattern.
Its intent is to minimize memory usage by reducing the number of instantiations of a given object.
I will show you how to implement a robust flyweight in C++, as well as a way to make it templatable for easy use with no boiler-plate.