~/talk

Template Metaprogramming: Type Traits (part 1 of 2)

Talkat CppCon 2020 · 2020-09-14..09-18· at 10:30· destroy_n(), online· [rust]
links:none on file
slides:none on file

Walks through implementing many std type traits from first principles, showing actual code patterns: integral_constant and true_type/false_type as value-and-type returns, alias helpers like underscore_t/_v for calling conventions, and remove_const via partial specialization. Explains when compiler intrinsics are required, why specializing standard templates or using incomplete types causes undefined behavior, and how C++17 auto non-type params and C++20 concepts change implementations. Examples compile and expose the precise rule that makes each trait correct.

AI-written summary · about

  1. 0:00Intro
  2. 0:21Intended Audience
  3. 8:18Tutorial Format
  4. 16:14Value Metafunctions: Sum
  5. 19:09Calling Type Metafunctions
  6. 21:17Convenience Calling Conventions
  7. 28:37Cpp17UnaryType Trait
  8. 30:18Cpp17Transformation Trait
  9. 31:14Undefined Behavior
  10. 33:51is_void (Unary Type Trait)
  11. 44:58remove_const(Transformation Trait)
  12. 53:46conditional
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.