~/talk

C++20 Concepts

Talkat ACCU 2022 · 2022-04-06..04-09· [c-and-cpp, compilers-and-language-design]
slides:none on file

Demonstrates using C++20 Concepts to replace a 19-class, inheritance-heavy libc++ implementation of libc++ optional with a single class, cutting 1187 lines to 1068 and eliminating repeated equals-default/delete boilerplate; destructor, copy and move logic use trailing requires to select implementations instead of base-class specialization. Tests pass libc++ optional test suite, and a simple compile benchmark shows ~463 ms → ~391 ms (≈72 ms) faster compilation with the concept-based version; clang lacked a needed feature so g++ was used.

AI-written summary · about

  1. 0:00Intro
  2. 1:50Concepts
  3. 3:45Applications
  4. 7:25Requirements
  5. 10:07Concepts in other places
  6. 12:00Function templates
  7. 14:20Rethink the past
  8. 14:57Inheritance for everything
  9. 20:02Java Interface
  10. 21:13C Interface
  11. 27:31Implements
  12. 35:16Inheritance
  13. 36:12Dependent Constructor
  14. 37:13Destructor
  15. 38:13Updating STL
  16. 40:30Optional Destructor
  17. 42:28Optional Storage
  18. 49:43Optional Template
  19. 50:40Diagram
  20. 52:41Constructor
  21. 53:59Copy
  22. 56:43Summary
~/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.