~/talk

C++26 Contracts: Pitfalls to Watch Ran

Talkat Core C++ 2025 · on Sunday, 2025-10-19· [c-and-cpp]
name:Regev
links:none on file
slides:none on file

C++26 contracts are ordinary code, so contract functions carry bugs found in real git branches and compiler implementations (GCC/Clang). Examples show a precondition on an empty view that unpredictably fails, const vs non‑const overloads that make code non‑viable, unresolved semantics for virtual/inherited contracts, and preconditions are code. Violation handlers differ by observe/enforce mode; throwing from a handler can bypass destructors and leak memory (demonstrated with Valgrind) leading to noexcept + contract = terminate and hard-to-test behaviors.

AI-written summary · about

  1. 0:00Introduction
  2. 0:24What are contracts
  3. 1:27Contracts are code too
  4. 3:56Preconditions on pointers
  5. 4:58Contract semantics
  6. 7:13Const vs non-const in contracts
  7. 12:13Overloaded functions in contracts
  8. 16:57Contracts on virtual functions
  9. 18:46Violation handlers
  10. 20:56Memory leaks from contracts
  11. 23:10Noexcept libraries and contracts
  12. 25:47Testing contracts
  13. 28:53Debugging contracts
  14. 32:02Common contract mistakes
  15. 34:09Reflection and contracts
  16. 36:13Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.