T: Templates and generic programming

Generic programming is programming using types and algorithms parameterized by types, values, and algorithms. In C++, generic programming is supported by the template language mechanisms.

Arguments to generic functions are characterized by sets of requirements on the argument types and values involved. In C++, these requirements are expressed by compile-time predicates called concepts.

Templates can also be used for meta-programming; that is, programs that compose code at compile time.

Template use rule summary:

Concept use rule summary:

Concept definition rule summary:

Template interface rule summary:

Template definition rule summary:

Template and hierarchy rule summary:

Variadic template rule summary:

Metaprogramming rule summary:

Other template rules summary: