Back to Basics: Concepts in C++
Talkat CppCon 2024 · on Wednesday, 2024-09-18· at 14:00· Maple 3/4/5, 6700 North Gaylord Rockies Boulevard·
summary
Explains how C++20 concepts name concrete requirements and use requires clauses to fix real problems — e.g. two add overloads resolved by a has_push_back concept, handling references via remove_cvref or range element utilities, and constraining Auto parameters. Demonstrates combining constraints, subsumption hierarchies, using compile-time if for alternate bodies, member and non-type (prime) constraints, notes measurable compile-time cost and varying error-message quality across compilers. compile-time if
AI-written summary · about
chapters (13)
- 0:00Introduction to concepts
- 3:30Defining and using concepts
- 8:16Concept constraints and testing
- 11:22Abbreviated function templates
- 14:21Requires clauses and type traits
- 18:57Multi-parameter concepts
- 25:24Standard library ranges and constraints
- 29:36Requires expression vs clause
- 32:29Compile-time ifs and better errors
- 38:02Concept subsumption and hierarchies
- 46:17Semantic requirements
- 50:21Class templates and parameters
- 56:43Q&A and conclusion
related talks
01h 04mC++ Concepts
01h 05mGeneric Programming with Concepts Lite, Part II
58mGeneric Programming with Concepts Lite, Part I
01h 11mC++20 Templates: The next level: Concepts and more
01h 03mBack to Basics: Declarations in C++
05mLightning Talks: -std=c++20 -- Will This C++ Code Compile?
06mLightning Talk: C++20 - A New Way of Meta-Programming?
07mLightning Talk: Higher-Order Template Metaprogramming with C++23
