tmp/tmpqsi2whlx/{from.md → to.md}
RENAMED
|
@@ -4,11 +4,11 @@
|
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
template <class T> class slice_array {
|
| 8 |
public:
|
| 9 |
-
|
| 10 |
|
| 11 |
void operator= (const valarray<T>&) const;
|
| 12 |
void operator*= (const valarray<T>&) const;
|
| 13 |
void operator/= (const valarray<T>&) const;
|
| 14 |
void operator%= (const valarray<T>&) const;
|
|
@@ -38,13 +38,14 @@ slice_array<T> valarray<T>::operator[](slice);
|
|
| 38 |
```
|
| 39 |
|
| 40 |
It has reference semantics to a subset of an array specified by a
|
| 41 |
`slice` object.
|
| 42 |
|
| 43 |
-
The expression `a[slice(1, 5, 3)] = b;` has the effect of
|
| 44 |
-
elements of `b` to a slice of the elements in `a`. For the
|
| 45 |
-
the elements selected from `a` are 1, 4, ...,
|
|
|
|
| 46 |
|
| 47 |
#### `slice_array` assignment <a id="slice.arr.assign">[[slice.arr.assign]]</a>
|
| 48 |
|
| 49 |
``` cpp
|
| 50 |
void operator=(const valarray<T>&) const;
|
|
@@ -53,11 +54,11 @@ const slice_array& operator=(const slice_array&) const;
|
|
| 53 |
|
| 54 |
These assignment operators have reference semantics, assigning the
|
| 55 |
values of the argument array elements to selected elements of the
|
| 56 |
`valarray<T>` object to which the `slice_array` object refers.
|
| 57 |
|
| 58 |
-
#### `slice_array`
|
| 59 |
|
| 60 |
``` cpp
|
| 61 |
void operator*= (const valarray<T>&) const;
|
| 62 |
void operator/= (const valarray<T>&) const;
|
| 63 |
void operator%= (const valarray<T>&) const;
|
|
@@ -68,11 +69,11 @@ void operator&= (const valarray<T>&) const;
|
|
| 68 |
void operator|= (const valarray<T>&) const;
|
| 69 |
void operator<<=(const valarray<T>&) const;
|
| 70 |
void operator>>=(const valarray<T>&) const;
|
| 71 |
```
|
| 72 |
|
| 73 |
-
These
|
| 74 |
indicated operation to the elements of the argument array and selected
|
| 75 |
elements of the `valarray<T>` object to which the `slice_array` object
|
| 76 |
refers.
|
| 77 |
|
| 78 |
#### `slice_array` fill function <a id="slice.arr.fill">[[slice.arr.fill]]</a>
|
|
|
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
template <class T> class slice_array {
|
| 8 |
public:
|
| 9 |
+
using value_type = T;
|
| 10 |
|
| 11 |
void operator= (const valarray<T>&) const;
|
| 12 |
void operator*= (const valarray<T>&) const;
|
| 13 |
void operator/= (const valarray<T>&) const;
|
| 14 |
void operator%= (const valarray<T>&) const;
|
|
|
|
| 38 |
```
|
| 39 |
|
| 40 |
It has reference semantics to a subset of an array specified by a
|
| 41 |
`slice` object.
|
| 42 |
|
| 43 |
+
[*Example 1*: The expression `a[slice(1, 5, 3)] = b;` has the effect of
|
| 44 |
+
assigning the elements of `b` to a slice of the elements in `a`. For the
|
| 45 |
+
slice shown, the elements selected from `a` are 1, 4, ...,
|
| 46 |
+
13. — *end example*]
|
| 47 |
|
| 48 |
#### `slice_array` assignment <a id="slice.arr.assign">[[slice.arr.assign]]</a>
|
| 49 |
|
| 50 |
``` cpp
|
| 51 |
void operator=(const valarray<T>&) const;
|
|
|
|
| 54 |
|
| 55 |
These assignment operators have reference semantics, assigning the
|
| 56 |
values of the argument array elements to selected elements of the
|
| 57 |
`valarray<T>` object to which the `slice_array` object refers.
|
| 58 |
|
| 59 |
+
#### `slice_array` compound assignment <a id="slice.arr.comp.assign">[[slice.arr.comp.assign]]</a>
|
| 60 |
|
| 61 |
``` cpp
|
| 62 |
void operator*= (const valarray<T>&) const;
|
| 63 |
void operator/= (const valarray<T>&) const;
|
| 64 |
void operator%= (const valarray<T>&) const;
|
|
|
|
| 69 |
void operator|= (const valarray<T>&) const;
|
| 70 |
void operator<<=(const valarray<T>&) const;
|
| 71 |
void operator>>=(const valarray<T>&) const;
|
| 72 |
```
|
| 73 |
|
| 74 |
+
These compound assignments have reference semantics, applying the
|
| 75 |
indicated operation to the elements of the argument array and selected
|
| 76 |
elements of the `valarray<T>` object to which the `slice_array` object
|
| 77 |
refers.
|
| 78 |
|
| 79 |
#### `slice_array` fill function <a id="slice.arr.fill">[[slice.arr.fill]]</a>
|