Templates & Generics

Lessons in this group, roughly in build order:

  • function-templates — A function template is a recipe the compiler stamps into a concrete function once per distinct set of…
  • class-templates — A class template parameterizes a type (and/or values) into a class definition; instantiating it with…
  • template-specialization — Specialization provides an alternative implementation of a template for specific argument(s), letting one…
  • variadic-templates — A variadic template takes a parameter pack — zero or more template arguments — enabling type-safe…
  • concepts-c-20 — A concept is a named, compile-time predicate on template parameters that constrains what types a template…
  • sfinae — SFINAE — Substitution Failure Is Not An Error — is the rule that a template whose signature becomes…
  • template-metaprogramming — Template metaprogramming (TMP) is computation performed by the compiler, using templates and constexpr as…