Everything About ___
Live briefing

Everything about Template metaprogramming

Metaprogramming technique

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. Wikipedia →

🧭 Start here: a 6-step reading path

  1. Read the overview: Template metaprogrammingA 5-minute orientation
  2. Pick up a classic book: C++ Template Metaprogramming in PracticeThe most-reprinted book on the subject
  3. Read the landmark paper: Discontinuous Galerkin method on three-dimensional tetrahedral grids. The use of template metaprogramming of the C++ languageCited 6 times
  4. Go sideways: Template (C++)A closely related topic
  5. Go sideways: Compile-time function executionA closely related topic

📖 Definitions

Noun A form of metaprogramming in which templates are used by a compiler to generate temporary source code, which is then merged with the rest of the source code and recompiled.

🏆 Landmark papers (most cited)

📚 Books worth reading

Ranked by number of editions on Open Library, a rough measure of how lasting a book is.

🔗 Related topics