What Does It Take to Implement the C++ Standard Library? Follow-up: Mandates vs Constraints?
summary
Short recap and concrete rule: the standard distinguishes mandates vs constraints and that determines implementation technique. When a paragraph is a mandate the program is ill formed so use static_assert to produce a clear diagnostic; when it is a constraint use a requires clause so the function is removed from overload resolution. Example: pair piecewise constructor is a mandate so static_assert; conversion assignment is a constraint so requires works. Use requires to exclude overloads, static_assert to enforce interface without removing them.
AI-written summary · about
chapters (6)
related talks
01h 29mWhat Does It Take to Implement the C++ Standard Library?
57mHow To Implement the C++ Standard Library - (Part 1 of 2)
06mConstraints not Satisfied
55mC++ Core and Other C++ Guidelines - The Good, the Bad, the… Questionable?
01h 13mThe 10 Essential Features for the Future of C++ Libraries
01h 32mThe 10 Essential Features for the Future of C++ Libraries
55mWhen C++ Style Guides Contradict
01h 36mThe Incredible Shrinking Standard
