Movatterモバイル変換


[0]ホーム

URL:


This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-12-20


2107. Lifetime of temporaries for default arguments in array copying

Section:6.8.7  [class.temporary]    Status:CD4    Submitter:Hubert Tong    Date:2015-03-19

[Adopted at the February, 2016 meeting.]

The lifetime of temporaries introduced for defaultarguments in array copying is not specified clearly.Presumably it should be treated like default arguments indefault constructors (6.8.7 [class.temporary] paragraph4), which deletes each element's set of default argumenttemporaries before construction of the next element.

Proposed resolution (September, 2015):

Change 6.8.7 [class.temporary] paragraphs 4-5 as follows:

There aretwothree contexts in which temporariesare destroyed at a different point than the end of the full-expression. Thefirst context is when a default constructor is called to initialize anelement of an arraywith no corresponding initializer(9.5 [dcl.init]). The second context is when a copy constructoris called to copy an element of an array while the entire array is copied(7.5.6 [expr.prim.lambda],11.4.5.3 [class.copy.ctor]).IfIn either case,if the constructor has one or more default arguments, the destructionof every temporary created in a default argument is sequenced before theconstruction of the next array element, if any.

Thesecondthird context is when a reference isbound to a temporary.117 The temporary to which the reference isbound...




[8]ページ先頭

©2009-2026 Movatter.jp