~/talk

C++20 - My Favourite Code Examples

Talkat NDC TechTown 2022 · 2022-08-29..09-01· [c-and-cpp]
slides:none on file

C++20 examples show concrete code: generic add() overloads resolved with concepts + constraints instead of SFINAE, ranges and views used to pipe, take, drop and transform collections, and jthread + stop_token plus atomic_ref for thread-safe parallel initialization. The chrono calendar/timezone types let code iterate months safely or choose last-day semantics. Demonstrations expose surprising failure modes: ambiguous overloads, view begin caching causing data races, and a runtime error from misused drop — with exact fixes and tradeoffs.

AI-written summary · about

  1. 0:00C++20 favorites intro
  2. 1:55Simplified function templates
  3. 4:01Overload resolution with concepts
  4. 8:01Requirements vs constraints
  5. 13:16When to use concepts
  6. 16:57Concepts for error messages
  7. 19:52Ranges and views
  8. 23:47Sentinels in ranges
  9. 27:21Universal references
  10. 35:24Thread safety with jthread
  11. 41:09Chrono extensions
  12. 44:47Combining C++20 features
  13. 46:35Sales data with ranges
  14. 50:36Runtime errors in views
  15. 55:12Caching in views
  16. 57:18C++20 summary
~/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.