~/talk

What Does It Take to Implement the C++ Standard Library? Follow-up: Mandates vs Constraints?

Talkat C++Online 2024 · 2024-02-28..03-02· [c-and-cpp]
slides:none on file

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

  1. 0:00Intro
  2. 1:17Words of Power
  3. 1:48Mandates
  4. 3:26Constraints
  5. 4:43When to use
  6. 5:19Outro
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.