“The Quiet Little Gem in Modern C++: <system_error>”
summary
Claim: std::error_code is the right, tiny (≈16‑byte) handle for error interchange — use enumerations as the contract and libraries implement an error_category single‑ton to attach strings and mappings. It ships with Boost Asio and the filesystem/networking TS, preserves platform‑specific detail non‑lossily, and lets modules map domains to common codes (POSIX errc) for interoperability. std::error_condition is rarely needed; an error_code API is simple to add (ten‑to‑fifteen minutes) and it works.
AI-written summary · about
chapters (7)
- 0:00Introduction to system_error
- 10:15Error codes vs messages
- 20:50Event notification with enums
- 30:09Handle-in-context pattern
- 40:00Library author implementation
- 50:36Using error_code as user
- 1:02:28Q&A and closing remarks
related talks
01h 00mThe Dawn of a New Error
01h 35mMongrel Monads, Dirty, Dirty, Dirty
04mErrors: forgotten, but not gone
59m“The Exception Situation"
49mFunctional Error and Optional-value Handling with STX
44mA Practical Approach to Error Handling
57m“The Unexceptional Exceptions"
54mMonadic Operations in Modern C++: A Practical Approach
