C++ Concepts for Developers
summary
C++20 adds concepts as compile‑time constraints on template parameters that check whether expressions compile but cannot enforce semantic axioms (cannot prove sortedness or algebraic laws). They replace many enable_if hacks, enable clearer single error messages, support non‑type templates, and new patterns like constrained auto and disjunctions of concepts for overload resolution. Concepts let code express domain roles (e.g., “archivable” if save or dump exists) without editing types, reduce runtime overhead versus virtual interfaces, but contracts (runtime pre/postconditions) are not included.
AI-written summary · about
chapters (23)
- 0:00Intro
- 1:08C++ concepts
- 2:26History of concepts
- 8:11What can concepts achieve (and what not)?
- 10:21Concepts and contracts
- 11:16Concepts and other languages
- 13:18Types and scaling development
- 17:32Concepts as a form of introspection
- 20:25Concepts and metaprogramming
- 21:43Concepts and hierarchies
- 25:08Concepts and type erasure
- 27:53Concepts vs object-orientation
- 32:46Concepts and design patterns
- 34:19Concepts as application roles
- 36:39Concepts check syntax only
- 37:45Concepts check code syntax or values
- 38:55Concept syntax variations
- 41:19Concepts - variables and functions
- 42:00Conjunction and disjunction
- 47:16Concepts and unit testing
- 48:00Things that you can do only with concepts
- 49:58Concepts and the C++ Core Guidelines
- 50:35Summary
related talks
01h 39m“Concepts: The Future of Generic Programming (the future is here)”
01h 00mConcepts in C++20: Revolution or Evolution
52mConcepts: The Future of Generic Programming
01h 11mConcepts in 60: Everything you need to know and nothing you don't
01h 07mConcepts As She Is Spoke
01h 28mC++ Concepts "Lite" in Practice
01h 27mC++20 Templates - the Next Level: Concepts and More
59mMetaprogramming: From Templates to Concepts
