C++ Regular, Revisited
summary
Revisits what “regular” means for C++ types and shows concrete pitfalls: C++20 Concepts and the spaceship operator change equality but require care; std::optional<T> and optional<T&> behave differently; string_view compares lexicographically (deep) while span is not regular because copy is shallow and deep equality would surprise users; sort requires a strict weak ordering or it breaks; recommendation is explicit: prefer types that model built-ins and make equality, copy and lifetime semantics consistent.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 1:47Revisiting regular types in C++
- 3:36Regular types foundations
- 6:03STL design principles
- 13:12Math in type design
- 17:15STL concepts and requirements
- 23:21Sorting requirements
- 29:03Equality and equivalence
- 34:52Semi-regular vs regular types
- 37:03Equality for value types
- 40:11C++17 vocabulary types
- 48:00Span non-regular type
- 57:07Lifetime safety implications
- 57:30Make types regular
- 1:04:53Q&A








