Content deleted Content added
→Static polymorphism: ref |
inline references |
||
Line 1:
The '''curiously recurring template pattern''' ('''CRTP''') is a [[C++]] idiom in which a class <code>X</code> derives from a class template instantiation using <code>X</code> itself as template argument. The name of this idiom was coined by [[Jim Coplien]]<ref>{{
== General form ==
Line 16:
</source>
Some use cases for this pattern are [[Template metaprogramming#
== Static polymorphism ==
Line 92:
==In other languages==
The CRTP makes an appearance in the [[Java language|Java programming language]] standard library where the [[Enumerated type|Enum]] class is defined as <code>Enum<T extends Enum<T>></code>.
==See also==
Line 99:
==References==
<references/>
<!-- can somebody inline this reference in a relevant place?
* {{note|Abrahams}}[[David Abrahams]], Aleksey Gurtovoy: ''C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond'', Addison-Wesley, ISBN 0-321-22725-5
-->
[[Category:Software design patterns]]
|