Structured Bindings demystified
summary
Explains that structured bindings declare identifiers for subobjects not for the whole object, so the bound names refer to members and not a named temporary. Shows the surprising ABI/semantics consequence: structured bindings disable RVO for the bound subobject so a copy can occur where a plain auto pair would let RVO apply. Demonstrates the tuple protocol (tuple_size / tuple_element / get) and a practical pattern: a single templated friend get using forwarding references and decay that generates the needed reference categories and works for lvalue/rvalue/const cases.
AI-written summary · about
chapters (6)
related talks
12mGeneric Binding
01h 07mBack to Basics: Templates (part 2 of 2)
05mWishful Thinking
52mBuilding Bridges: C++ Interop, Foreign Function Interfaces & ABI
36mThe language that isn't
05mF.21
01h 01mBreaking Dependencies - C++ Type Erasure - The Implementation Details
28m"Rust Interop: Memory Safety Across Foreign Function Boundaries"
