C++20 – My Favourite Code Examples
summary
Walks through concrete C++20 code: replaces template overloads with concepts solve overload ambiguity using requires expressions; uses ranges and views are cheap but break const propagation to slice and transform vectors with sentinels and take/transform pipelines; shows compile-time computation with consteval, arrays and view pairs to return variable-length results; demonstrates jthread + stop_token and atomic_ref to avoid thread joins and races; notes format library and coroutines/modules are not yet portable and some GCC/MSVC diagnostics still lag.
AI-written summary · about
chapters (15)
- 0:00Start
- 2:11Function Template
- 2:37Function Templates
- 6:20Ambiguity Error
- 23:31Error Message
- 32:29Range Base for Loop
- 36:41Spaceship Operators
- 39:36Format Library
- 48:19Universal References
- 50:12Composers
- 53:26Match the Sizes
- 1:13:32Systays
- 1:14:31Illegitimate Operator Abuse
- 1:21:38Atomic Ref
- 1:28:01Modules
related talks
01h 02mC++20 - My Favourite Code Examples
59mC++20 - My Favourite Code Examples
01h 27mC++20 Templates - the Next Level: Concepts and More
01h 01mC++20: What's in it for you?
55mTemplates Made Easy With C++20
59mC++20: An (Almost) Complete Overview
05mPostmodern Meta C++
01h 07mC++20 Concepts: A Day in the Life
