tmp/tmpw4clx1__/{from.md → to.md}
RENAMED
|
@@ -138,12 +138,13 @@ not add more than two levels of template nesting over the most deeply
|
|
| 138 |
nested argument type.[^7]
|
| 139 |
|
| 140 |
Implementations introducing such replacement types shall provide
|
| 141 |
additional functions and operators as follows:
|
| 142 |
|
| 143 |
-
- for every function taking a `const valarray<T>&`
|
| 144 |
-
|
|
|
|
| 145 |
- for every function taking two `const valarray<T>&` arguments,
|
| 146 |
identical functions taking every combination of `const valarray<T>&`
|
| 147 |
and replacement types shall be added.
|
| 148 |
|
| 149 |
In particular, an implementation shall allow a `valarray<T>` to be
|
|
@@ -352,16 +353,14 @@ the assignment.
|
|
| 352 |
|
| 353 |
``` cpp
|
| 354 |
valarray<T>& operator=(valarray<T>&& v) noexcept;
|
| 355 |
```
|
| 356 |
|
| 357 |
-
*Effects:* `*this` obtains the value of `v`.
|
| 358 |
-
|
| 359 |
-
the same length, as if by calling `resize(v.size())`, before performing
|
| 360 |
-
the assignment.
|
| 361 |
|
| 362 |
-
*Complexity:*
|
| 363 |
|
| 364 |
``` cpp
|
| 365 |
valarray& operator=(initializer_list<T> il);
|
| 366 |
```
|
| 367 |
|
|
@@ -415,12 +414,12 @@ Likewise, the expression `&a[i] != &b[j]` evaluates as `true` for any
|
|
| 415 |
two arrays `a` and `b` and for any `size_t i` and `size_t j` such that
|
| 416 |
`i` is less than the length of `a` and `j` is less than the length of
|
| 417 |
`b`. This property indicates an absence of aliasing and may be used to
|
| 418 |
advantage by optimizing compilers.[^13]
|
| 419 |
|
| 420 |
-
The reference returned by the subscript operator for an array
|
| 421 |
-
|
| 422 |
`resize(size_t, T)` ([[valarray.members]]) is called for that array or
|
| 423 |
until the lifetime of that array ends, whichever happens first.
|
| 424 |
|
| 425 |
If the subscript operator is invoked with a `size_t` argument whose
|
| 426 |
value is not less than the length of the array, the behavior is
|
|
@@ -645,11 +644,11 @@ void swap(valarray& v) noexcept;
|
|
| 645 |
size_t size() const;
|
| 646 |
```
|
| 647 |
|
| 648 |
*Returns:* The number of elements in the array.
|
| 649 |
|
| 650 |
-
*Complexity:*
|
| 651 |
|
| 652 |
``` cpp
|
| 653 |
T sum() const;
|
| 654 |
```
|
| 655 |
|
|
@@ -919,11 +918,11 @@ size_t size() const;
|
|
| 919 |
size_t stride() const;
|
| 920 |
```
|
| 921 |
|
| 922 |
*Returns:* The start, length, or stride specified by a `slice` object.
|
| 923 |
|
| 924 |
-
*Complexity:*
|
| 925 |
|
| 926 |
### Class template `slice_array` <a id="template.slice.array">[[template.slice.array]]</a>
|
| 927 |
|
| 928 |
#### Class template `slice_array` overview <a id="template.slice.array.overview">[[template.slice.array.overview]]</a>
|
| 929 |
|
|
@@ -1371,10 +1370,15 @@ iterator ([[random.access.iterators]]) whose `value_type` is the
|
|
| 1371 |
template parameter `T` and whose `reference` type is `T&`.
|
| 1372 |
*unspecified*2 is a type that meets the requirements of a constant
|
| 1373 |
random access iterator ([[random.access.iterators]]) whose `value_type`
|
| 1374 |
is the template parameter `T` and whose `reference` type is `const T&`.
|
| 1375 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1376 |
``` cpp
|
| 1377 |
template <class T> unspecified{1} begin(valarray<T>& v);
|
| 1378 |
template <class T> unspecified{2} begin(const valarray<T>& v);
|
| 1379 |
```
|
| 1380 |
|
|
|
|
| 138 |
nested argument type.[^7]
|
| 139 |
|
| 140 |
Implementations introducing such replacement types shall provide
|
| 141 |
additional functions and operators as follows:
|
| 142 |
|
| 143 |
+
- for every function taking a `const valarray<T>&` other than `begin`
|
| 144 |
+
and `end` ([[valarray.range]]), identical functions taking the
|
| 145 |
+
replacement types shall be added;
|
| 146 |
- for every function taking two `const valarray<T>&` arguments,
|
| 147 |
identical functions taking every combination of `const valarray<T>&`
|
| 148 |
and replacement types shall be added.
|
| 149 |
|
| 150 |
In particular, an implementation shall allow a `valarray<T>` to be
|
|
|
|
| 353 |
|
| 354 |
``` cpp
|
| 355 |
valarray<T>& operator=(valarray<T>&& v) noexcept;
|
| 356 |
```
|
| 357 |
|
| 358 |
+
*Effects:* `*this` obtains the value of `v`. The value of `v` after the
|
| 359 |
+
assignment is not specified.
|
|
|
|
|
|
|
| 360 |
|
| 361 |
+
*Complexity:* Linear.
|
| 362 |
|
| 363 |
``` cpp
|
| 364 |
valarray& operator=(initializer_list<T> il);
|
| 365 |
```
|
| 366 |
|
|
|
|
| 414 |
two arrays `a` and `b` and for any `size_t i` and `size_t j` such that
|
| 415 |
`i` is less than the length of `a` and `j` is less than the length of
|
| 416 |
`b`. This property indicates an absence of aliasing and may be used to
|
| 417 |
advantage by optimizing compilers.[^13]
|
| 418 |
|
| 419 |
+
The reference returned by the subscript operator for an array shall be
|
| 420 |
+
valid until the member function
|
| 421 |
`resize(size_t, T)` ([[valarray.members]]) is called for that array or
|
| 422 |
until the lifetime of that array ends, whichever happens first.
|
| 423 |
|
| 424 |
If the subscript operator is invoked with a `size_t` argument whose
|
| 425 |
value is not less than the length of the array, the behavior is
|
|
|
|
| 644 |
size_t size() const;
|
| 645 |
```
|
| 646 |
|
| 647 |
*Returns:* The number of elements in the array.
|
| 648 |
|
| 649 |
+
*Complexity:* Constant time.
|
| 650 |
|
| 651 |
``` cpp
|
| 652 |
T sum() const;
|
| 653 |
```
|
| 654 |
|
|
|
|
| 918 |
size_t stride() const;
|
| 919 |
```
|
| 920 |
|
| 921 |
*Returns:* The start, length, or stride specified by a `slice` object.
|
| 922 |
|
| 923 |
+
*Complexity:* Constant time.
|
| 924 |
|
| 925 |
### Class template `slice_array` <a id="template.slice.array">[[template.slice.array]]</a>
|
| 926 |
|
| 927 |
#### Class template `slice_array` overview <a id="template.slice.array.overview">[[template.slice.array.overview]]</a>
|
| 928 |
|
|
|
|
| 1370 |
template parameter `T` and whose `reference` type is `T&`.
|
| 1371 |
*unspecified*2 is a type that meets the requirements of a constant
|
| 1372 |
random access iterator ([[random.access.iterators]]) whose `value_type`
|
| 1373 |
is the template parameter `T` and whose `reference` type is `const T&`.
|
| 1374 |
|
| 1375 |
+
The iterators returned by `begin` and `end` for an array are guaranteed
|
| 1376 |
+
to be valid until the member function `resize(size_t, T)` (
|
| 1377 |
+
[[valarray.members]]) is called for that array or until the lifetime of
|
| 1378 |
+
that array ends, whichever happens first.
|
| 1379 |
+
|
| 1380 |
``` cpp
|
| 1381 |
template <class T> unspecified{1} begin(valarray<T>& v);
|
| 1382 |
template <class T> unspecified{2} begin(const valarray<T>& v);
|
| 1383 |
```
|
| 1384 |
|