From Jason Turner

[valarray.cassign]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpzh3kwpvr/{from.md → to.md} +40 -40
tmp/tmpzh3kwpvr/{from.md → to.md} RENAMED
@@ -1,55 +1,55 @@
1
- #### `valarray` computed assignment <a id="valarray.cassign">[[valarray.cassign]]</a>
2
 
3
  ``` cpp
4
- valarray<T>& operator*= (const valarray<T>&);
5
- valarray<T>& operator/= (const valarray<T>&);
6
- valarray<T>& operator%= (const valarray<T>&);
7
- valarray<T>& operator+= (const valarray<T>&);
8
- valarray<T>& operator-= (const valarray<T>&);
9
- valarray<T>& operator^= (const valarray<T>&);
10
- valarray<T>& operator&= (const valarray<T>&);
11
- valarray<T>& operator|= (const valarray<T>&);
12
- valarray<T>& operator<<=(const valarray<T>&);
13
- valarray<T>& operator>>=(const valarray<T>&);
14
  ```
15
 
16
- Each of these operators may only be instantiated for a type `T` to which
17
- the indicated operator can be applied. Each of these operators performs
18
- the indicated operation on each of its elements and the corresponding
19
- element of the argument array.
 
20
 
21
- The array is then returned by reference.
 
22
 
23
- If the array and the argument array do not have the same length, the
24
- behavior is undefined. The appearance of an array on the left-hand side
25
- of a computed assignment does `not` invalidate references or pointers.
26
 
27
- If the value of an element in the left-hand side of a valarray computed
28
- assignment operator depends on the value of another element in that left
29
- hand side, the resulting behavior is undefined.
30
 
31
  ``` cpp
32
- valarray<T>& operator*= (const T&);
33
- valarray<T>& operator/= (const T&);
34
- valarray<T>& operator%= (const T&);
35
- valarray<T>& operator+= (const T&);
36
- valarray<T>& operator-= (const T&);
37
- valarray<T>& operator^= (const T&);
38
- valarray<T>& operator&= (const T&);
39
- valarray<T>& operator|= (const T&);
40
- valarray<T>& operator<<=(const T&);
41
- valarray<T>& operator>>=(const T&);
42
  ```
43
 
44
- Each of these operators may only be instantiated for a type `T` to which
45
- the indicated operator can be applied.
 
46
 
47
- Each of these operators applies the indicated operation to each element
48
- of the array and the non-array argument.
49
 
50
- The array is then returned by reference.
51
 
52
- The appearance of an array on the left-hand side of a computed
53
- assignment does *not* invalidate references or pointers to the elements
54
- of the array.
55
 
 
1
+ #### `valarray` compound assignment <a id="valarray.cassign">[[valarray.cassign]]</a>
2
 
3
  ``` cpp
4
+ valarray& operator*= (const valarray& v);
5
+ valarray& operator/= (const valarray& v);
6
+ valarray& operator%= (const valarray& v);
7
+ valarray& operator+= (const valarray& v);
8
+ valarray& operator-= (const valarray& v);
9
+ valarray& operator^= (const valarray& v);
10
+ valarray& operator&= (const valarray& v);
11
+ valarray& operator|= (const valarray& v);
12
+ valarray& operator<<=(const valarray& v);
13
+ valarray& operator>>=(const valarray& v);
14
  ```
15
 
16
+ *Requires:* `size() == v.size()`. Each of these operators may only be
17
+ instantiated for a type `T` if the indicated operator can be applied to
18
+ two operands of type `T`. The value of an element in the left-hand side
19
+ of a valarray compound assignment operator does not depend on the value
20
+ of another element in that left hand side.
21
 
22
+ *Effects:* Each of these operators performs the indicated operation on
23
+ each of the elements of `*this` and the corresponding element of `v`.
24
 
25
+ *Returns:* `*this`.
 
 
26
 
27
+ *Remarks:* The appearance of an array on the left-hand side of a
28
+ compound assignment does not invalidate references or pointers.
 
29
 
30
  ``` cpp
31
+ valarray& operator*= (const T& v);
32
+ valarray& operator/= (const T& v);
33
+ valarray& operator%= (const T& v);
34
+ valarray& operator+= (const T& v);
35
+ valarray& operator-= (const T& v);
36
+ valarray& operator^= (const T& v);
37
+ valarray& operator&= (const T& v);
38
+ valarray& operator|= (const T& v);
39
+ valarray& operator<<=(const T& v);
40
+ valarray& operator>>=(const T& v);
41
  ```
42
 
43
+ *Requires:* Each of these operators may only be instantiated for a type
44
+ `T` if the indicated operator can be applied to two operands of type
45
+ `T`.
46
 
47
+ *Effects:* Each of these operators applies the indicated operation to
48
+ each element of `*this` and `v`.
49
 
50
+ *Returns:* `*this`
51
 
52
+ *Remarks:* The appearance of an array on the left-hand side of a
53
+ compound assignment does not invalidate references or pointers to the
54
+ elements of the array.
55