Created on 2013-09-15.00:00:00 last changed 94 months ago
[Moved to DR at the November, 2014 meeting.]
Proposed resolution (February, 2014):
Change 6.7.3 [basic.life] paragraph 1 as follows:
The lifetime of an object is a runtime property of the object. An object is said to have
non-trivial initializationnon-vacuous initialization if it is of a class or aggregate type and it or one of its members is initialized by a constructor other than a trivial default constructor. [Note: initialization by a trivial copy/move constructor isnon-trivialnon-vacuous initialization. —end note] The lifetime of an object of type T begins when:
storage with the proper alignment and size for type T is obtained, and
if the object has
non-trivialnon-vacuous initialization, its initialization is complete.The lifetime of an object...
The description of is_trivially_constructible in 21.3.5.4 [meta.unary.prop] paragraph 3 says,
is_constructible<T, Args...>::value is true and the variable definition for is_constructible, as defined below, is known to call no operation that is not trivial ( 6.8 [basic.types], 11.4.4 [special]).
This risks confusion when compared with the wording in 6.7.3 [basic.life] paragraph 1,
An object is said to have non-trivial initialization if it is of a class or aggregate type and it or one of its members is initialized by a constructor other than a trivial default constructor. [Note: initialization by a trivial copy/move constructor is non-trivial initialization. —end note]
The latter was written long before “trivial” became an important concept in its own right and uses the term differently from how it is used elsewhere in the Standard (as evidenced by the note referring to copy/move construction). The intent is to capture the idea that there is some actual initialization occurring; it should be rephrased to avoid the potential of confusion with the usage of “trivial” elsewhere.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
2015-04-13 00:00:00 | admin | set | messages: + msg5334 |
2014-11-24 00:00:00 | admin | set | status: ready -> dr |
2014-03-03 00:00:00 | admin | set | messages: + msg4803 |
2014-03-03 00:00:00 | admin | set | status: open -> ready |
2013-09-15 00:00:00 | admin | create |