~/talk

Narrow Contracts and `noexcept` are Inherently Incompatible in C++

Talkat ACCU 2024 · 2024-04-17..04-20· [c-and-cpp]
slides:none on file

Argues that the Lakos Rule forbids adding `noexcept` to any function with a narrow contract because `noexcept` changes program behavior and the type-system view of a function, causing accidental termination, breaking negative tests and handlers that need to throw, and violating Liskov-style backward compatibility. Shows concrete examples (checked-vector vs checked-vector-with-`noexcept`, handler strategies: observe/enforce/trap), proves `noexcept` is only justified for move ops or as a non-queryable attribute like throws-nothing, and recommends keeping `noexcept` out of narrow-contract library specs.

AI-written summary · about

  1. 0:00Introduction
  2. 3:27Leos rule on noexcept and contracts
  3. 14:44Function contracts and preconditions
  4. 27:31Design by contract vs LSP
  5. 41:32LSP in practice and compatibility
  6. 57:46Why noexcept and contracts clash
  7. 1:03:00Handlers in safety systems
  8. 1:12:55When noexcept helps
  9. 1:20:46Conclusion and Q&A invitation
~/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.