Subobject Polymorphic Overlay Pattern -- Félix-Olivier Dumas
In this article, I explore the Subobject Polymorphic Overlay Pattern (SPO), an experimental architectural idiom that inverts the classic contract model of static polymorphism. Instead of the implementation inheriting from an interface, the interface becomes a clean, selective view over an independent implementation. The result is zero-overhead compile-time polymorphism that avoids some of the usual drawbacks of traditional CRTP and std::variant based approaches, while still remaining explicit about its trade-offs and experimental nature.
Subobject Polymorphic Overlay Pattern (SPO): An Architectural Idiom for Static Polymorphism
by Félix-Olivier Dumas
From the article:
Nowadays, C++ is one of the most influential programming languages in the world. Over the past 40 years, it has proven itself in fields ranging from aerospace engineering to your basement at 2 a.m. [...]
To this day, there are two major categories when it comes to polymorphism in C++: static polymorphism and dynamic polymorphism. Although they share the same underlying philosophy, the reality is that they are extremely different from one another, both in implementation and in usage.