Daily bit(e) of C++ | Curiously Recurring Template Pattern
Daily bit(e) of C++ #218, The C++ technique for passing type information about a derived class to the base class: Curiously Recurring Template Pattern.
Curiously Recurring Template Pattern (CRTP) is a C++ technique allowing us to pass type information about a derived class to a base class.
A typical use case for CRTP is Mixin support, where we encapsulate functionality into a base class without relying on virtual dispatch. This way, the derived class can avoid becoming polymorphic and potentially remain trivially copyable.