Title
Missing restriction in [numeric.requirements]
Status
c++17
Section
[numeric.requirements]
Submitter
Hubert Tong

Created on 2016-05-03.00:00:00 last changed 89 months ago

Messages

Date: 2016-08-06.20:44:18

Proposed resolution:

This wording is relative to N4582.

  1. Adjust [numeric.requirements]/1 as indicated:

    -1- The complex and valarray components are parameterized by the type of information they contain and manipulate. […]

    1. (1.1) — T is not an abstract class (it has no pure virtual member functions);

    2. […]

    3. (1.8) — If T is a class, its assignment operator, copy and default constructors, and destructor shall correspond to each other in the following sense: Initialization of raw storage using the copy constructor on the value of T(), however obtained, is semantically equivalent to value initialization of the same raw storage. Initialization of raw storage using the default constructor, followed by assignment, is semantically equivalent to initialization of raw storage using the copy constructor. Destruction of an object, followed by initialization of its raw storage using the copy constructor, is semantically equivalent to assignment to the original object. [Note: This rule states, in part, that there shall not be any subtle differences in the semantics of initialization versus assignment. This gives an implementation considerable flexibility in how arrays are initialized. [Example: An implementation is allowed to initialize a valarray by allocating storage using the new operator (which implies a call to the default constructor for each element) and then assigning each element its value. Or the implementation can allocate raw storage and use the copy constructor to initialize each element. — end example] If the distinction between initialization and assignment is important for a class, or if it fails to satisfy any of the other conditions listed above, the programmer should use vector (23.3.11) instead of valarray for that class; — end note]

Date: 2016-08-03.00:00:00

[ 2016-08-03 Chicago ]

Fri AM: Moved to Tentatively Ready

Date: 2016-05-03.00:00:00

In N4582 subclause [numeric.requirements], the "considerable flexibility in how arrays are initialized" do not appear to allow for replacement of calls to the default constructor with calls to the copy constructor with an appropriate source value.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-11-14 03:59:28adminsetstatus: pending -> wp
2016-11-14 03:55:22adminsetstatus: ready -> pending
2016-08-06 20:44:18adminsetmessages: + msg8441
2016-08-06 20:44:18adminsetstatus: new -> ready
2016-05-08 12:33:57adminsetmessages: + msg8098
2016-05-03 00:00:00admincreate