The paper systematizes CRTP for implementing design patterns via static polymorphism, highlighting C++23 features.
The paper systematises the application of the Curiously Recurring Template Pattern (CRTP) for implementing GoF design patterns via static polymorphism without virtual functions. Five characteristic cases are identified: the static Template Method, the Null Object as an alternative to a real object, the Observer through a tuple (std::tuple) and fold expression, the Decorator through the variadic recursive template Wrap, and the Command through a variadic tuple. It is shown that a tuple combined with std::apply forms a modern infrastructure for static patterns. The explicit object parameters feature (deducing this) of C++23 is analysed as a natural evolution of CRTP that simplifies syntax while preserving zero-overhead semantics. The functional idiom of recursive lambdas through explicit object parameters is also examined.
No takes yet. Share an insight, caveat, or question.
Volodymyr Boublik (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: