This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Dup status.
Section: 126.96.36.199 [valarray.access] Status: Dup Submitter: Levente Farkas Opened: 1998-09-09 Last modified: 2016-02-10
Priority: Not Prioritized
View all other issues in [valarray.access].
View all issues with Dup status.
Duplicate of: 389
T operator (size_t) const;
const T& operator (size_t) const;
as in vector ???
One can't copy even from a const valarray eg:
memcpy(ptr, &v, v.size() * sizeof(double));
[I] find this bug in valarray is very difficult.
The LWG believes that the interface was deliberately designed that way. That is what valarray was designed to do; that's where the "value array" name comes from. LWG members further comment that "we don't want valarray to be a full STL container." 188.8.131.52 [valarray.access] specifies properties that indicate "an absence of aliasing" for non-constant arrays; this allows optimizations, including special hardware optimizations, that are not otherwise possible.