~/talk

How to Build Cpp Interfaces That Are Hard to Use Incorrectly

Talkat C++ on Sea 2023 · 2023-06-28..06-30· [c-and-cpp]
slides:none on file

Argues that the C++ type system, not wider contracts, prevents common bugs by moving precondition checks to compile time and shows concrete fixes: replacing raw ints for OpenGL glTexImage2D with enum class opaque handles, wrapping handles in a templated struct, using std::span and designated initializers to avoid memset/argument-order errors, switching variants to visit+overload trick, applying execution tokens and “state-as-types” for Vulkan-like command buffers, and using clang‑tidy move checks; demos compile-time gains, added type boilerplate, and runtime trade-offs.

AI-written summary · about

  1. 0:00Intro
  2. 0:45Motivation
  3. 4:01Overview
  4. 19:27Type System to the rescue!
  5. 27:30Structuring arguments
  6. 31:02Structured Data Access
  7. 37:11Declarative Interface
  8. 47:54Execution Tokens
  9. 49:38Scoped Execution Contexts
  10. 52:42Complex State Machines
  11. 55:14The GoF State Pattern
  12. 56:44Conclusion
~/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.