From Jason Turner

[valarray.members]

Diff to HTML by rtfpessoa

tmp/tmpugk736ui/{from.md → to.md} RENAMED
@@ -1,6 +1,6 @@
1
- #### `valarray` member functions <a id="valarray.members">[[valarray.members]]</a>
2
 
3
  ``` cpp
4
  void swap(valarray& v) noexcept;
5
  ```
6
 
@@ -19,33 +19,34 @@ size_t size() const;
19
 
20
  ``` cpp
21
  T sum() const;
22
  ```
23
 
24
- *Requires:* `size() > 0`. This function may only be instantiated for a
25
- type `T` to which `operator+=` can be applied.
 
26
 
27
  *Returns:* The sum of all the elements of the array. If the array has
28
  length 1, returns the value of element 0. Otherwise, the returned value
29
  is calculated by applying `operator+=` to a copy of an element of the
30
  array and all other elements of the array in an unspecified order.
31
 
32
  ``` cpp
33
  T min() const;
34
  ```
35
 
36
- *Requires:* `size() > 0`
37
 
38
  *Returns:* The minimum value contained in `*this`. For an array of
39
  length 1, the value of element 0 is returned. For all other array
40
  lengths, the determination is made using `operator<`.
41
 
42
  ``` cpp
43
  T max() const;
44
  ```
45
 
46
- *Requires:* `size() > 0`.
47
 
48
  *Returns:* The maximum value contained in `*this`. For an array of
49
  length 1, the value of element 0 is returned. For all other array
50
  lengths, the determination is made using `operator<`.
51
 
@@ -60,13 +61,13 @@ is `(*this)[`*`I`*` + n]` if *`I`*` + n` is non-negative and less than
60
  [*Note 1*: If element zero is taken as the leftmost element, a positive
61
  value of `n` shifts the elements left `n` places, with zero
62
  fill. — *end note*]
63
 
64
  [*Example 1*: If the argument has the value -2, the first two elements
65
- of the result will be value-initialized ([[dcl.init]]); the third
66
- element of the result will be assigned the value of the first element of
67
- the argument; etc. — *end example*]
68
 
69
  ``` cpp
70
  valarray cshift(int n) const;
71
  ```
72
 
 
1
+ #### Member functions <a id="valarray.members">[[valarray.members]]</a>
2
 
3
  ``` cpp
4
  void swap(valarray& v) noexcept;
5
  ```
6
 
 
19
 
20
  ``` cpp
21
  T sum() const;
22
  ```
23
 
24
+ *Mandates:* `operator+=` can be applied to operands of type `T`.
25
+
26
+ *Preconditions:* `size() > 0` is `true`.
27
 
28
  *Returns:* The sum of all the elements of the array. If the array has
29
  length 1, returns the value of element 0. Otherwise, the returned value
30
  is calculated by applying `operator+=` to a copy of an element of the
31
  array and all other elements of the array in an unspecified order.
32
 
33
  ``` cpp
34
  T min() const;
35
  ```
36
 
37
+ *Preconditions:* `size() > 0` is `true`.
38
 
39
  *Returns:* The minimum value contained in `*this`. For an array of
40
  length 1, the value of element 0 is returned. For all other array
41
  lengths, the determination is made using `operator<`.
42
 
43
  ``` cpp
44
  T max() const;
45
  ```
46
 
47
+ *Preconditions:* `size() > 0` is `true`.
48
 
49
  *Returns:* The maximum value contained in `*this`. For an array of
50
  length 1, the value of element 0 is returned. For all other array
51
  lengths, the determination is made using `operator<`.
52
 
 
61
  [*Note 1*: If element zero is taken as the leftmost element, a positive
62
  value of `n` shifts the elements left `n` places, with zero
63
  fill. — *end note*]
64
 
65
  [*Example 1*: If the argument has the value -2, the first two elements
66
+ of the result will be value-initialized [[dcl.init]]; the third element
67
+ of the result will be assigned the value of the first element of the
68
+ argument; etc. — *end example*]
69
 
70
  ``` cpp
71
  valarray cshift(int n) const;
72
  ```
73