C Template Metaprogramming Concepts Official
Uses static constexpr to return a result (e.g., calculating a factorial at compile time).
Introduced heavily in , these are standard metafunctions used to query properties of types. They allow your code to ask questions like: "Is this type a pointer?" ( std::is_pointer ) "Are these two types the same?" ( std::is_same ) "Can I add these two types together?" 5. Concepts (C++20) C Template Metaprogramming Concepts
TMP is a purely sub-language. Because the compiler cannot "change" a value once it is defined during a build, you don't use loops or variables. Instead, you use: Recursion: To mimic loops. Uses static constexpr to return a result (e