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

2023-01-15


1751. Non-trivial operations vs non-trivial initialization

Section: 6.7.3  [basic.life]     Status: CD4     Submitter: Nico Josuttis     Date: 2013-09-15

[Moved to DR at the November, 2014 meeting.]

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.

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 initialization non-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 is non-trivial non-vacuous initialization. —end note] The lifetime of an object of type T begins when:

The lifetime of an object...