Fast and Small - What are the Costs of Language Features
summary
Examines concrete costs and compiler behavior for modern C++ features with code-level effects and fixes: auto and decltype(auto) are compile-time only but braced initialization can yield unexpected references, range-for always caches end and uses pre-increment so it avoids per-iteration calls, lambdas become compiler-generated classes whose size grows with captures and unused captures are optimized away, structured bindings create a hidden temporary then reference its members, and function-local statics get runtime guards (atomics/locks) only for non-trivial ctors.
AI-written summary · about
chapters (9)
- 0:00Introduction to C++ costs
- 2:48The auto keyword
- 6:01Decltype and auto
- 10:06Macro pitfalls
- 16:19Range-based for loops
- 22:07Loop internals and C++14
- 25:55Lambda expressions
- 34:25Structured bindings
- 43:07Static variable safety
related talks
50mC++ Costless Abstractions: the compiler view
59mModern C++ for Fun and Profit: This isn’t your old C++
01h 03mC++20: The small things
01h 35mImpact on maintainability and refactoring for higher-level design features
51mModern techniques for keeping your code dry
01h 01mFunctional C++
01h 00mMoving Faster: Everyday efficiency in modern C++
54mTypical C++, But Why?
