Content deleted Content added
ThomasJMarko (talk | contribs) →Compile-time class generation: Add information on consteval from C++20 |
No edit summary Tags: Mobile edit Mobile web edit |
||
Line 2:
{{Programming paradigms}}
'''Template metaprogramming''' ('''TMP''') is a [[metaprogramming]] technique in which [[Generic programming|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 include [[compile time|compile-time]] [[constant (programming)|constant]]s, [[data structure]]s, and complete [[function (computer science)|function]]s. The use of templates can be thought of as [[Compile time function execution|compile-time
Template metaprogramming was, in a sense, discovered accidentally.<ref name="Meyers2005">{{cite book|author=Scott Meyers|title=Effective C++: 55 Specific Ways to Improve Your Programs and Designs|url=https://books.google.com/books?id=Qx5oyB49poYC&printsec=frontcover#v=onepage&q=%22Template%20metaprogramming%22&f=false|date=12 May 2005|publisher=Pearson Education|isbn=978-0-13-270206-5}}</ref><ref>See [[wikibooks:C++ Programming/Templates/Template Meta-Programming#History of TMP|History of TMP]] on Wikibooks</ref>
|