~/talk

“Concepts and Contracts: When, What, and How”

Talkat CppCon 2018 · 2018-09-23..09-28· [compilers-and-language-design]
links:none on file
slides:none on file

Goal: implement a library function template that accepts exactly one positive integral parameter and rejects zero, negatives, chars, bools, non-integers, and extra args. Multiple implementations are shown: explicit specializations (fragile), std::type_traits checks, a wrapper integral<T> helper, and a clean concepts-based signature combined with an expects contract for runtime preconditions. Examples compile and run from the GitHub repo; tool reality: GCC -fconcepts and experimental Clang forks exist, contracts support is sparse, front-ends disagree, and contracts expose axiom-for-static-tools and problematic constexpr/runtime interactions.

AI-written summary · about

  1. 0:00Introduction and setup
  2. 1:59What are concepts and contracts
  3. 2:21Concepts implementation status
  4. 3:24Concepts example with outable
  5. 6:36Contracts overview and example
  6. 9:06Contracts implementation status
  7. 14:07Solving the challenge with traits
  8. 21:04Concepts features and requires clauses
  9. 23:37Contracts with attributes
  10. 26:50Concepts with named constraints
  11. 29:44Combining concepts and contracts
  12. 35:08Applying to standard library
  13. 45:40Uncheckable contracts and axioms
  14. 52:10Compile-time contract checking
  15. 58:48Future integration of features
  16. 1:00:14Summary and Q&A
~/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.