“Declarative Control Flow"
summary
Argues that exception cleanup becomes declarative by generalizing Scope Guard into three primitives and using the exception-count API to detect failures. Implements lightweight wrappers around std::uncaught_exceptions and exposes scope_exit, scope_fail, scope_success semantics so code states cleanup goals instead of nesting try/catch or inventing tiny RAII types. Shows transactional file-copy/move examples, points to Folly and MSVC implementations already working, and reports the facility is standardized for C++17, yielding flatter, smaller, and more maintainable error-handling code.
AI-written summary · about
chapters (18)
- 0:00Introduction and context
- 6:01Transactional file copying
- 10:12Transactional file moving
- 13:22Control flow issues
- 15:12Declarative programming
- 17:22Scope guard basics
- 20:15Macro implementation
- 23:31Advanced scope management
- 25:58C++17 and exceptions
- 29:15Handling exception counts
- 32:40Conditional execution
- 35:55Scope fail macro
- 37:23Refactoring examples
- 38:40Sequence dependencies
- 41:59Guard types and use cases
- 44:01Performance and patterns
- 49:40Summary of benefits
- 52:34Library support and Q&A
related talks
59m“The Exception Situation"
01h 00mThe Dawn of a New Error
01h 02mBack to Basics: Exceptions
01h 01mEasy to Use, Hard to Misuse: Declarative Style in C++
44mA Practical Approach to Error Handling
01h 35mMongrel Monads, Dirty, Dirty, Dirty
01h 00mError Handling is Cancelling Operations
01h 17mFunction Contracts in Practice using C++
