File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44954495\pnum
44964496\indextext {initializer!temporary and declarator}%
44974497\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
44994499point than the end of the full-expression.
45004500The first context is when a default constructor is called to initialize
45014501an element of an array with no corresponding initializer\iref {dcl.init }.
46214621the object persists for the lifetime of the reference
46224622initialized by the \grammarterm {for-range-initializer}.
46234623
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+
46244632\pnum
46254633Let \tcode {x} and \tcode {y} each be either
46264634a temporary object whose lifetime is not extended, or
59065914\item
59075915an immediate invocation\iref {expr.const },
59085916\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
59105919a \grammarterm {mem-initializer}\iref {class.base.init },
59115920including the constituent expressions of the initializer,
59125921\item
Original file line number Diff line number Diff line change 70997099Each $ \tcode {v}_i$ is the name of an lvalue of type $ \tcode {T}_i$
71007100that refers to the object bound to $ \tcode {r}_i$ ;
71017101the 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$ .
71027106
71037107\pnum
71047108Otherwise,
You can’t perform that action at this time.
0 commit comments