~/talk

C++20 Templates - the next level

Talkat Meeting C++ 2021 · 2021-11-10..11-12· [rust]
slides:none on file

Claims that C++20 makes templates readable and testable with concrete features backed by Compiler Explorer and compile-time checks. Concepts and the requires expression let code state and reuse four concrete checks (same-type, operator+, noexcept, return-type) instead of obscure enable_if hacks. Non-type template parameters accept doubles and class-like fixed_string values. Lambdas gain a template head so a templated lambda can enforce identical parameter types. Tests use static_assert on concepts to fail at compile time.

AI-written summary · about

  1. 0:00Start
  2. 2:09Concepts
  3. 11:37The Requires Clause
  4. 13:57Constraint Placeholder Types
  5. 15:17Trailing Required Clause
  6. 17:58Return Type
  7. 18:38Requires Expression
  8. 21:20Simple Requirement
  9. 21:33Sample Requirement
  10. 22:49Nested Requirement
  11. 24:26The Compound Requirement
  12. 27:16Ad Hoc Constraint
  13. 32:22Abbreviated Function Templates
  14. 38:09Inheritance
  15. 41:11Error Messages
  16. 48:38Fixed String Container
  17. 55:25Concept Cheat Sheet
  18. 1:00:22Static Assert
~/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.