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 4500
4500
\pnum
4501
4501
\indextext {initializer!temporary and declarator}%
4502
4502
\indextext {temporary!order of destruction of}%
4503
- There are four contexts in which temporaries are destroyed at a different
4503
+ There are five contexts in which temporaries are destroyed at a different
4504
4504
point than the end of the full-expression.
4505
4505
The first context is when a default constructor is called to initialize
4506
4506
an element of an array with no corresponding initializer\iref {dcl.init }.
4626
4626
the object persists for the lifetime of the reference
4627
4627
initialized by the \grammarterm {for-range-initializer}.
4628
4628
4629
+ \pnum
4630
+ The fifth context is when a temporary object
4631
+ is created in a structured binding declaration\iref {dcl.struct.bind }.
4632
+ Any temporary objects introduced by
4633
+ the \grammarterm {initializer}{s} for the variables
4634
+ with unique names
4635
+ are destroyed at the end of the structured binding declaration.
4636
+
4629
4637
\pnum
4630
4638
Let \tcode {x} and \tcode {y} each be either
4631
4639
a temporary object whose lifetime is not extended, or
5911
5919
\item
5912
5920
an immediate invocation\iref {expr.const },
5913
5921
\item
5914
- an \grammarterm {init-declarator}\iref {dcl.decl } or
5922
+ an \grammarterm {init-declarator}\iref {dcl.decl }
5923
+ (including such introduced by a structured binding\iref {dcl.struct.bind }) or
5915
5924
a \grammarterm {mem-initializer}\iref {class.base.init },
5916
5925
including the constituent expressions of the initializer,
5917
5926
\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 \le j$ .
7102
7106
7103
7107
\pnum
7104
7108
Otherwise,
You can’t perform that action at this time.
0 commit comments