Copy Elision
summary
Explains the concrete claim that compilers generally construct return objects in caller storage so copies are elided, using low‑level stack‑frame diagrams and compiled calling conventions as the tool. Demonstrates three cases: a straightforward return (RVO succeeds), a conditional return (RVO can fail because the chosen object is unknown at compile time), and passing temporaries (elision applies only to temporaries only). Notes the practical surprise that copy‑constructor side effects may not run and shows corrected examples and slides that validate the behavior.
AI-written summary · about
related talks
08mReturn Values Take A Closure Walk
01h 01mC++ RVO: Return Value Optimization for Performance in Bloomberg C++ Codebases
01h 03mto pass and return, the story of functions, values and compilers
44mPragmatic Type Erasure: Solving OOP Problems w/ Elegant Design Pattern
01h 03mType Erasure - The Implementation Details
01h 03mHidden Overhead of a Function API
01h 02mBreaking Dependencies: Type Erasure - A Design Analysis
01h 06mThe Hidden Secrets of Move Semantics
