File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 4495
4495
\pnum
4496
4496
\indextext {initializer!temporary and declarator}%
4497
4497
\indextext {temporary!order of destruction of}%
4498
- There are four contexts in which temporaries are destroyed at a different
4498
+ There are five contexts in which temporaries are destroyed at a different
4499
4499
point than the end of the full-expression.
4500
4500
The first context is when a default constructor is called to initialize
4501
4501
an element of an array with no corresponding initializer\iref {dcl.init }.
4621
4621
the object persists for the lifetime of the reference
4622
4622
initialized by the \grammarterm {for-range-initializer}.
4623
4623
4624
+ \pnum
4625
+ The fifth context is when a temporary object
4626
+ is created in a structured binding declaration\iref {dcl.struct.bind }.
4627
+ Any temporary objects introduced by
4628
+ the \grammarterm {initializer}{s} for the variables
4629
+ with unique names
4630
+ are destroyed at the end of the structured binding declaration.
4631
+
4624
4632
\pnum
4625
4633
Let \tcode {x} and \tcode {y} each be either
4626
4634
a temporary object whose lifetime is not extended, or
5906
5914
\item
5907
5915
an immediate invocation\iref {expr.const },
5908
5916
\item
5909
- an \grammarterm {init-declarator}\iref {dcl.decl } or
5917
+ an \grammarterm {init-declarator}\iref {dcl.decl }
5918
+ (including such introduced by a structured binding\iref {dcl.struct.bind }) or
5910
5919
a \grammarterm {mem-initializer}\iref {class.base.init },
5911
5920
including the constituent expressions of the initializer,
5912
5921
\item
Original file line number Diff line number Diff line change 7099
7099
Each $ \tcode {v}_i$ is the name of an lvalue of type $ \tcode {T}_i$
7100
7100
that refers to the object bound to $ \tcode {r}_i$ ;
7101
7101
the referenced type is $ \tcode {T}_i$ .
7102
+ The initialization of \exposid {e} is
7103
+ sequenced before the initialization of any $ \tcode {r}_i$ .
7104
+ The initialization of each $ \tcode {r}_i$ is
7105
+ sequenced before the initialization of any $ \tcode {r}_j$ where $ i < j$ .
7102
7106
7103
7107
\pnum
7104
7108
Otherwise,
You can’t perform that action at this time.
0 commit comments