C++ Logo

std-discussion

Advanced search

std::valarray<T>::resize

From: Vladimir Grigoriev <vlad.moscow_at_[hidden]>
Date: Fri, 11 Oct 2019 14:42:23 +0300
The effect of the member function resize of the class std::valarray looks very strange compared with the same member function for example of the class std::vector. Why are all elements are set to T() (or to the specified value) instead of the elements that are appended to an object of the type std::valarray? This only confuses users of the class.

With best regards,
Vlad from Moscow

You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com

Received on 2019-10-11 06:44:38