CRTP(Curiously recurring template pattern) 소개
CRTP(Curiously recurring template pattern) CRTP는 클래스 X가 X 자신을 템플릿 인자로 사용하여 클래스 템플릿 인스턴스화로부터 파생되게 하는 C++ 표현(Idiom, 관용구 )이다. 이 표현 이름은 1995년에 Jim Coplien에 의해 만들어 졌다. [Wikipedia 정의] The curiously recurring template pattern (CRTP) is an idiom in C++ in which a class X derives from a class template instantiation using X itself as template argument.[1] More generally it is known as F-bound polymorphism, and it is a form of F-bounded quantification. The technique was formalized in the 1980s as "F-bounded quantification."The name "CRTP" was independently coined by Jim Coplien in 1995, who had observed it in some of the earliest C++ template code as well as in code examples that Timothy Budd created in his multiparadigm language Leda. 1. 일반적 형식 // The Curiously Recurring Template Pattern (CRTP) template < class T > class Base { // methods within Base can use template to access members of Derived }; class Derived : public Base < Derived ...