Curiously Recurring Template Pattern
From cppreference.com
The Curiously Recurring Template Pattern is an idiom in which a class X derives from a class template Y, taking a template parameter Z, where Y is instantiated with Z=X. For example,
Run this code
template<class Z> class Y { }; class X : public Y<X> { };
See also
(C++11) |
allows an object to create a shared_ptr referring to itself (class template) |
helper class template for defining views, using the curiously recurring template pattern (class template) |