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


508. Non-constructed value-initialized objects

Section:9.5  [dcl.init]    Status:C++11    Submitter:Alisdair Meredith    Date:18 Mar 2005

[Voted into WP at August, 2010 meeting.]

According to the definition ofvalue initialization(9.5 [dcl.init] paragraph 5), non-union class types withoutuser-declared constructors are value-initialized by value-initializingeach of their members rather than by executing the (generated)default constructor. However, a number of other items in theStandard are described in relationship to the execution of theconstructor:

Proposed resolution (October, 2005):

Add the indicated words to 9.5 [dcl.init] paragraph 6:

A program that calls for default-initialization orvalue-initialization of an entity of reference type is ill-formed. IfT is a cv-qualified type, the cv-unqualified versionofT is used for these definitions of zero-initialization,default-initialization, and value-initialization.Even whenvalue-initialization of an object does not call that object'sconstructor, the object is deemed to have been fully constructed onceits initialization is complete and thus subject to provisions of thisInternational Standard applying to “constructed” objects,objects “for which the constructor has completedexecution,” etc.

Notes from April, 2006 meeting:

There was some concern about whether this wording covered (orneeded to cover) cases where an object is “partiallyconstructed.” Another approach might be simply to definevalue initialization to be “construction.” Returned to“drafting” status for further investigation.

Proposed resolution (February, 2010):

Change 9.5 [dcl.init] paragraph 7 as follows:

Tovalue-initialize an object of typeT means:

An object that is value-initialized is deemed to be constructedand thus subject to provisions of this International Standard applyingto “constructed” objects, objects “for which theconstructor has completed,” etc., even if no constructor is invokedfor the object's initialization.




[8]ページ先頭

©2009-2026 Movatter.jp