[C++] Combine Type Erasure And Strategies
Thomas Thomas

[C++] Combine Type Erasure And Strategies

In this example we combine type erasure with a strategy like pattern. We continue with a character type from my first article about type erasure and we’ll add a rendering method to them without modifying the concrete classes. This increases encapsulation on our example and demonstrates how powerful this combination could be.

Read More
[C++] Use Type Erasure To Get Dynamic Polymorphic Behavior
Thomas Thomas

[C++] Use Type Erasure To Get Dynamic Polymorphic Behavior

This is a simple and short example to understand the idea of type erasure. In this article we create a simple class which can erase your concrete types and illustrates the general behavior and what it requres to have polymorphic behavior at runtime. For a more comprehensive understanding and include tests, I recommend watching Klaus Iglbergers talk about this topic from CppCon 2022.

Read More