C++11 in the Wild: Techniques from a Real Codebase
summary
Concrete takeaways: Auto macro implements scope‑exit RAII with lambdas, token‑pasting and __COUNTER__, compiles down to inlined, zero‑overhead code (std::function version shows heavy allocations and calls). make_iterable() wraps two pointers into a begin/end view so legacy pointer+size objects iterate with range‑for. spaceship() gives an efficient tuple comparator that avoids double work by folding elementwise comparisons at compile time. Benchmarks and assembly examples show these ideas actually work.
AI-written summary · about
chapters (10)
- 0:00Intro
- 1:27What we'll cover
- 5:33Choose Your Own Digression
- 14:46Let's see some codegen!
- 24:09Type erasure in a nutshell
- 32:30One odd application
- 44:01Inside-out containers
- 46:23Motivating use case (LLVM)
- 50:41First attempt: LLVM to the rescue!
- 53:12The idiom we want to use in C++14








