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


2849. Parameter objects are not temporary objects

Section:6.8.7  [class.temporary]    Status:CD7    Submitter:Brian Bi    Date:2024-01-20

[Accepted as a DR at the March, 2024 meeting.]

(From submission#490.)

Parameter objects are not temporary objects, according to6.8.7 [class.temporary] paragraph 1. An exception hinting at this in6.8.7 [class.temporary] paragraph 7 should be removed.

Proposed resolution (approved by CWG 2024-02-02):

Change in 6.8.7 [class.temporary] paragraph 7 as follows:

The fourth context is when a temporary objectother than afunction parameter object is created inthefor-range-initializer of a range-based for statement. Ifsuch a temporary object would otherwise be destroyed at the end ofthefor-range-initializer full-expression, the object persistsfor the lifetime of the reference initialized bythefor-range-initializer.



[8]ページ先頭

©2009-2026 Movatter.jp