Structured Binding Assignments (P3817)
summary
Proposal adds a way to map structure-binding entries to already-declared variables using the keyword using x so bindings perform assignment rather than declaration. It requires a modifiable lvalue (postfix/unary expressions allowed), defines left-to-right evaluation and per-decomposition rules for arrays/tuple-like/aggregate cases, and preserves existing ref/auto semantics for copy/move. An experimental implementation exists as Clang/Godbolt prototype (R0 implemented, R1 wording in progress) and behaves as specified.
AI-written summary · about
chapters (12)
- 0:00Introduction to P3817
- 1:29What is structured binding assignment
- 4:41Motivation for the feature
- 7:07Proposal details and syntax
- 12:44Semantics and evaluation order
- 16:00Ref-qualifiers and copying behavior
- 19:56Placeholder and duplicate targets
- 23:14Real-world use cases
- 25:24Syntax alternatives considered
- 26:47Implementation and Clang support
- 27:51Changes from R0 to R1
- 33:56Q&A session
