Return Values Take A Closure Walk
summary
Claim: pass return values up the stack without knowing their concrete type by decoupling call site and implementation. Implementation uses std::function type erasure instead of templating, creates a declared result variable captured by reference inside a wrapper lambda, calls the real callable, stores and returns the result, and relies on std::move prevents copies. Special-case metaprogramming handles void return and wrapping the result in boost::optional for failures reports errors back to the caller.
AI-written summary · about
related talks
59mTaming Lambdas' uniqueness
01h 10mstd::function: a deep dive behind the curtain
05mCopy Elision
05mForwarding Values... and Backwarding Them Too?
48mBack to Basics: Cpp Value Semantics
01h 02mEmbracing Trailing Return Types and `auto` Return SAFELY in Modern C++
01h 10mstd::function: a deep dive behind the curtain
57mC++: λ Demystified
