Title
valarray helpers missing augmented assignment operators
Status
nad
Section
[valarray.cassign]
Submitter
Gabriel Dos Reis

Created on 1999-08-15.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

Although perhaps an unfortunate design decision, the omission is not a defect in the current standard.  A future standard may wish to add the missing operators.

Date: 1999-08-15.00:00:00

26.5.2.6 defines augmented assignment operators valarray<T>::op=(const T&), but fails to provide corresponding versions for the helper classes. Thus making the following illegal:

#include <valarray>

int main()
{
std::valarray<double> v(3.14, 1999);

v[99] *= 2.0; // Ok

std::slice s(0, 50, 2);

v[s] *= 2.0; // ERROR
}

I can't understand the intent of that omission. It makes the valarray library less intuitive and less useful.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1803
1999-08-15 00:00:00admincreate