~/talk

Back to Basics: C++ API Design

Talkat CppCon 2022 · 2022-09-11..09-16· [rust]
slides:none on file

Argues for concrete rules: mark getters no discard, mark non‑throwing functions no accept, prefer returning unique_ptr or an expected‑style type over raw pointers, avoid implicit conversions and delete dangerous overloads, pick one in‑band error strategy (exceptions or std::expected / "stood expected"), make factory semantics explicit, and run sanitizer‑backed fuzzers against the API to find real misuse. Examples include vector.empty, fopen mode parsing, and factory return patterns.

AI-written summary · about

  1. 0:00Introduction
  2. 3:52Make your API hard to use wrong
  3. 8:08Understanding [[nodiscard]]
  4. 17:38Error handling with [[noexcept]]
  5. 23:19Factory functions and ownership
  6. 32:53No raw pointers and error handling
  7. 41:51Avoid implicit conversions
  8. 51:01Compile-time safety tricks
  9. 59:05Fuzzing API robustness
~/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.