This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations.(June 2010) (Learn how and when to remove this message)
Template metaprogramming (TMP) is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates can include compile-time constants, data structures, and complete functions. The use of templates can be thought of as compile-time polymorphism. The technique is used by a number of languages, the best-known being C++, but also Curl, D, Nim, and XL.
Template metaprogramming was, in a sense, discovered accidentally.[1][2]
Some other languages support similar, if not more powerful, compile-time facilities (such as Lisp macros), but those are outside the scope of this article.
^Scott Meyers (12 May 2005). Effective C++: 55 Specific Ways to Improve Your Programs and Designs. Pearson Education. ISBN 978-0-13-270206-5.
^See History of TMP on Wikibooks
and 13 Related for: Template metaprogramming information
Templatemetaprogramming (TMP) is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged...
documents Template (word processing), a standard document containing layout and styles used to configure word processing software Templatemetaprogramming, a...
reflection. Reflection is a valuable language feature to facilitate metaprogramming. Metaprogramming was popular in the 1970s and 1980s using list processing languages...
Expression templates are a C++ templatemetaprogramming technique that builds structures representing a computation at compile time, where expressions...
quantification Abrahams, David; Gurtovoy, Aleksey (January 2005). C++ TemplateMetaprogramming: Concepts, Tools, and Techniques from Boost and Beyond. Addison-Wesley...
above template in a template constraint: auto fun(Range)(Range range) if (isInputRange!Range) { // ... } In addition to templatemetaprogramming, D also...
parser generator framework implemented using templatemetaprogramming techniques. Expression templates allow users to approximate the syntax of extended...
precursor to polymers Tab Mix Plus, a Mozilla Firefox extension Templatemetaprogramming .tmp, a temporary folder in Unix or Linux systems Trusted Platform...
"Lisp-like macros". A similar effect can be achieved by using templatemetaprogramming in C++. In both cases, work is moved to compile-time. The difference...
for his pioneering work on policy-based design implemented via templatemetaprogramming. These ideas are articulated in his book Modern C++ Design and...
Alexandrescu: pioneering work on policy-based design implemented via templatemetaprogramming; co-inventor of D programming language. Ana Aslan: inventor of...