188. valarray helpers missing augmented assignment operators

Section: [valarray.cassign] Status: NAD Submitter: Gabriel Dos Reis Opened: 1999-08-15 Last modified: 2016-01-28 10:19:27 UTC

Priority: Not Prioritized

View all other issues in [valarray.cassign].

View all issues with NAD status.

Discussion: 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.


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.