From Jason Turner
Watch on YouTube

Summary

This episode explores the Curiously Recurring Template Pattern (CRTP), a C++ design pattern where a class inherits from a template instantiated with itself as the template parameter. Jason discusses the history and naming of this pattern, which emerged early in C++'s template support days. He demonstrates a practical application of CRTP by implementing comparison operators, showing how it enables creating mix-ins that extend functionality without virtual dispatch overhead.

Resources

Tags