Metaprogramming:
Metaprogramming
suggest changeIn C++ metaprogramming refers to the use of macros or templates to generate code at compile-time.
In general, macros are frowned upon in this role and templates are preferred, although they are not as generic.
Template metaprogramming often makes use of compile-time computations, whether via templates or constexpr functions, to achieve its goals of generating code, however compile-time computations are not metaprogramming.
Metaprogramming (or more specifically, template metaprogramming) is the practice of using templates to create constants, functions, or data structures at compile-time. This allows computations to be performed once at compile time rather than at each run time.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents
11Loops
14keywords
17Pointers
26std::map
29std::any
38File I/O
39Streams
41Metaprogramming
51Unions
56Lambdas
60SFINAE
62RAII
67Sorting
84RTTI
87Scopes
102Attributes
104Profiling
107Recursion
113Header files
117Iteration
125Alignment
133Optimization
134Semaphore
136Debugging
139Mutexes
141Unit testing
142decltype
146Contributors