Movatterモバイル変換


[0]ホーム

URL:


Issue 1489 - WG21 CWG Issues
Title
Is value-initialization of an array constant initialization?
Status
cd3
Section
6.10.3.2 [basic.start.static]
Submitter
Steve Adamczyk

Created on2012-03-29.00:00:00 last changed145 months ago

Messages

msg4371 (view)
Date: 2013-04-15.00:00:00

[Moved to DR at the April, 2013 meeting.]

msg4044 (view)
Date: 2012-10-15.00:00:00

Proposed resolution (October, 2012):

Change 6.10.3.2 [basic.start.static] paragraph 2 as follows:

Constant initialization is performed:

  • ...

  • if an object with static or thread storage duration is notinitialized by a constructor call and ifeither the object isvalue-initialized or every full-expression that appears in itsinitializer is a constant expression.

msg3913 (view)
Date: 2016-02-15.00:00:00

According to 6.10.3.2 [basic.start.static] paragraph 2,

Constant initialization is performed:

  • ...

  • if an object with static or thread storage duration is not initializedby a constructor call and if every full-expression that appears in itsinitializer is a constant expression.

Presumably this would include a value-initialization (i.e., with noexpressions) such as

  int a[1000]{};

However, we have recently clarified the degenerate cases of othersimilar rules referencing “every,” so it wouldn't hurt tobe more explicit here.

History
DateUserActionArgs
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-10-14 00:00:00adminsetstatus: dr -> drwp
2013-05-03 00:00:00adminsetmessages: +msg4371
2013-05-03 00:00:00adminsetstatus: ready -> dr
2012-11-03 00:00:00adminsetmessages: +msg4044
2012-11-03 00:00:00adminsetstatus: open -> ready
2012-03-29 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp