From Jason Turner

[valarray.cassign]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpeshg7xo9/{from.md → to.md} +11 -9
tmp/tmpeshg7xo9/{from.md → to.md} RENAMED
@@ -1,6 +1,6 @@
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);
@@ -11,15 +11,18 @@ 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`.
@@ -38,13 +41,12 @@ 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`
 
1
+ #### 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);
 
11
  valarray& operator|= (const valarray& v);
12
  valarray& operator<<=(const valarray& v);
13
  valarray& operator>>=(const valarray& v);
14
  ```
15
 
16
+ *Mandates:* The indicated operator can be applied to two operands of
17
+ type `T`.
18
+
19
+ *Preconditions:* `size() == v.size()` is `true`.
20
+
21
+ The value of an element in the left-hand side of a valarray compound
22
+ assignment operator does not depend on the value of another element in
23
+ that left hand side.
24
 
25
  *Effects:* Each of these operators performs the indicated operation on
26
  each of the elements of `*this` and the corresponding element of `v`.
27
 
28
  *Returns:* `*this`.
 
41
  valarray& operator|= (const T& v);
42
  valarray& operator<<=(const T& v);
43
  valarray& operator>>=(const T& v);
44
  ```
45
 
46
+ *Mandates:* The indicated operator can be applied to two operands of
47
+ type `T`.
 
48
 
49
  *Effects:* Each of these operators applies the indicated operation to
50
  each element of `*this` and `v`.
51
 
52
  *Returns:* `*this`