Overview
Syllabus
Intro
Motivation: Checking Type Constraints
Motivation: Algorithm Selection
Motivation: Compile-Time Computation Some fairly complex computations can be performed ahead-of-time
Reminder: Class Template Specialization
A large collection of metafunctions that check properties of types
Type Traits and static assert
Non-Constraining Use of Traits
Member Detection with void_t
Generalized Version (Expression SFINAE)
Specializing a Template Based on Traits - There are multiple approaches, each with its merits Hand-written template specialisation
Hand-Written Template Specialization
Tag Dispatch Overload functions on a type that depends on a type tra les
distance_helper
std::enable_if
Recursive Templates
Some Simple Uses
constexpr Over Types
Compile-Time Safe printf
Taught by
NDC Conferences