From Jason Turner

[alg.min.max]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmplmlhlsxl/{from.md → to.md} +33 -34
tmp/tmplmlhlsxl/{from.md → to.md} RENAMED
@@ -12,19 +12,19 @@ template<class T, class Proj = identity,
12
  ```
13
 
14
  *Preconditions:* For the first form, `T` meets the
15
  *Cpp17LessThanComparable* requirements ([[cpp17.lessthancomparable]]).
16
 
17
- *Returns:* The smaller value.
18
-
19
- *Remarks:* Returns the first argument when the arguments are equivalent.
20
- An invocation may explicitly specify an argument for the template
21
- parameter `T` of the overloads in namespace `std`.
22
 
23
  *Complexity:* Exactly one comparison and two applications of the
24
  projection, if any.
25
 
 
 
 
26
  ``` cpp
27
  template<class T>
28
  constexpr T min(initializer_list<T> r);
29
  template<class T, class Compare>
30
  constexpr T min(initializer_list<T> r, Compare comp);
@@ -42,20 +42,19 @@ template<input_range R, class Proj = identity,
42
  *Preconditions:* `ranges::distance(r) > 0`. For the overloads in
43
  namespace `std`, `T` meets the *Cpp17CopyConstructible* requirements.
44
  For the first form, `T` meets the *Cpp17LessThanComparable* requirements
45
  ([[cpp17.lessthancomparable]]).
46
 
47
- *Returns:* The smallest value in the input range.
48
-
49
- *Remarks:* Returns a copy of the leftmost element when several elements
50
- are equivalent to the smallest. An invocation may explicitly specify an
51
- argument for the template parameter `T` of the overloads in namespace
52
- `std`.
53
 
54
  *Complexity:* Exactly `ranges::distance(r) - 1` comparisons and twice as
55
  many applications of the projection, if any.
56
 
 
 
 
57
  ``` cpp
58
  template<class T>
59
  constexpr const T& max(const T& a, const T& b);
60
  template<class T, class Compare>
61
  constexpr const T& max(const T& a, const T& b, Compare comp);
@@ -66,19 +65,19 @@ template<class T, class Proj = identity,
66
  ```
67
 
68
  *Preconditions:* For the first form, `T` meets the
69
  *Cpp17LessThanComparable* requirements ([[cpp17.lessthancomparable]]).
70
 
71
- *Returns:* The larger value.
72
-
73
- *Remarks:* Returns the first argument when the arguments are equivalent.
74
- An invocation may explicitly specify an argument for the template
75
- parameter `T` of the overloads in namespace `std`.
76
 
77
  *Complexity:* Exactly one comparison and two applications of the
78
  projection, if any.
79
 
 
 
 
80
  ``` cpp
81
  template<class T>
82
  constexpr T max(initializer_list<T> r);
83
  template<class T, class Compare>
84
  constexpr T max(initializer_list<T> r, Compare comp);
@@ -96,20 +95,19 @@ template<input_range R, class Proj = identity,
96
  *Preconditions:* `ranges::distance(r) > 0`. For the overloads in
97
  namespace `std`, `T` meets the *Cpp17CopyConstructible* requirements.
98
  For the first form, `T` meets the *Cpp17LessThanComparable* requirements
99
  ([[cpp17.lessthancomparable]]).
100
 
101
- *Returns:* The largest value in the input range.
102
-
103
- *Remarks:* Returns a copy of the leftmost element when several elements
104
- are equivalent to the largest. An invocation may explicitly specify an
105
- argument for the template parameter `T` of the overloads in namespace
106
- `std`.
107
 
108
  *Complexity:* Exactly `ranges::distance(r) - 1` comparisons and twice as
109
  many applications of the projection, if any.
110
 
 
 
 
111
  ``` cpp
112
  template<class T>
113
  constexpr pair<const T&, const T&> minmax(const T& a, const T& b);
114
  template<class T, class Compare>
115
  constexpr pair<const T&, const T&> minmax(const T& a, const T& b, Compare comp);
@@ -123,16 +121,16 @@ template<class T, class Proj = identity,
123
  *Preconditions:* For the first form, `T` meets the
124
  *Cpp17LessThanComparable* requirements ([[cpp17.lessthancomparable]]).
125
 
126
  *Returns:* `{b, a}` if `b` is smaller than `a`, and `{a, b}` otherwise.
127
 
128
- *Remarks:* An invocation may explicitly specify an argument for the
129
- template parameter `T` of the overloads in namespace `std`.
130
-
131
  *Complexity:* Exactly one comparison and two applications of the
132
  projection, if any.
133
 
 
 
 
134
  ``` cpp
135
  template<class T>
136
  constexpr pair<T, T> minmax(initializer_list<T> t);
137
  template<class T, class Compare>
138
  constexpr pair<T, T> minmax(initializer_list<T> t, Compare comp);
@@ -155,17 +153,17 @@ requirements ([[cpp17.lessthancomparable]]).
155
 
156
  *Returns:* Let `X` be the return type. Returns `X{x, y}`, where `x` is a
157
  copy of the leftmost element with the smallest value and `y` a copy of
158
  the rightmost element with the largest value in the input range.
159
 
160
- *Remarks:* An invocation may explicitly specify an argument for the
161
- template parameter `T` of the overloads in namespace `std`.
162
-
163
  *Complexity:* At most (3/2)`ranges::distance(r)` applications of the
164
  corresponding predicate and twice as many applications of the
165
  projection, if any.
166
 
 
 
 
167
  ``` cpp
168
  template<class ForwardIterator>
169
  constexpr ForwardIterator min_element(ForwardIterator first, ForwardIterator last);
170
 
171
  template<class ExecutionPolicy, class ForwardIterator>
@@ -175,12 +173,11 @@ template<class ExecutionPolicy, class ForwardIterator>
175
  template<class ForwardIterator, class Compare>
176
  constexpr ForwardIterator min_element(ForwardIterator first, ForwardIterator last,
177
  Compare comp);
178
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
179
  ForwardIterator min_element(ExecutionPolicy&& exec,
180
- ForwardIterator first, ForwardIterator last,
181
- Compare comp);
182
 
183
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
184
  indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
185
  constexpr I ranges::min_element(I first, S last, Comp comp = {}, Proj proj = {});
186
  template<forward_range R, class Proj = identity,
@@ -260,23 +257,25 @@ template<class ExecutionPolicy, class ForwardIterator, class Compare>
260
  minmax_element(ExecutionPolicy&& exec,
261
  ForwardIterator first, ForwardIterator last, Compare comp);
262
 
263
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
264
  indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
265
- constexpr ranges::minmax_result<I>
266
  ranges::minmax_element(I first, S last, Comp comp = {}, Proj proj = {});
267
  template<forward_range R, class Proj = identity,
268
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
269
- constexpr ranges::minmax_result<borrowed_iterator_t<R>>
270
  ranges::minmax_element(R&& r, Comp comp = {}, Proj proj = {});
271
  ```
272
 
273
  *Returns:* `{first, first}` if \[`first`, `last`) is empty, otherwise
274
  `{m, M}`, where `m` is the first iterator in \[`first`, `last`) such
275
  that no iterator in the range refers to a smaller element, and where `M`
276
- is the last iterator[^5] in \[`first`, `last`) such that no iterator in
277
- the range refers to a larger element.
 
 
278
 
279
  *Complexity:* Let N be `last - first`. At most
280
  $\max(\bigl\lfloor{\frac{3}{2}} (N-1)\bigr\rfloor, 0)$ comparisons and
281
  twice as many applications of the projection, if any.
282
 
 
12
  ```
13
 
14
  *Preconditions:* For the first form, `T` meets the
15
  *Cpp17LessThanComparable* requirements ([[cpp17.lessthancomparable]]).
16
 
17
+ *Returns:* The smaller value. Returns the first argument when the
18
+ arguments are equivalent.
 
 
 
19
 
20
  *Complexity:* Exactly one comparison and two applications of the
21
  projection, if any.
22
 
23
+ *Remarks:* An invocation may explicitly specify an argument for the
24
+ template parameter `T` of the overloads in namespace `std`.
25
+
26
  ``` cpp
27
  template<class T>
28
  constexpr T min(initializer_list<T> r);
29
  template<class T, class Compare>
30
  constexpr T min(initializer_list<T> r, Compare comp);
 
42
  *Preconditions:* `ranges::distance(r) > 0`. For the overloads in
43
  namespace `std`, `T` meets the *Cpp17CopyConstructible* requirements.
44
  For the first form, `T` meets the *Cpp17LessThanComparable* requirements
45
  ([[cpp17.lessthancomparable]]).
46
 
47
+ *Returns:* The smallest value in the input range. Returns a copy of the
48
+ leftmost element when several elements are equivalent to the smallest.
 
 
 
 
49
 
50
  *Complexity:* Exactly `ranges::distance(r) - 1` comparisons and twice as
51
  many applications of the projection, if any.
52
 
53
+ *Remarks:* An invocation may explicitly specify an argument for the
54
+ template parameter `T` of the overloads in namespace `std`.
55
+
56
  ``` cpp
57
  template<class T>
58
  constexpr const T& max(const T& a, const T& b);
59
  template<class T, class Compare>
60
  constexpr const T& max(const T& a, const T& b, Compare comp);
 
65
  ```
66
 
67
  *Preconditions:* For the first form, `T` meets the
68
  *Cpp17LessThanComparable* requirements ([[cpp17.lessthancomparable]]).
69
 
70
+ *Returns:* The larger value. Returns the first argument when the
71
+ arguments are equivalent.
 
 
 
72
 
73
  *Complexity:* Exactly one comparison and two applications of the
74
  projection, if any.
75
 
76
+ *Remarks:* An invocation may explicitly specify an argument for the
77
+ template parameter `T` of the overloads in namespace `std`.
78
+
79
  ``` cpp
80
  template<class T>
81
  constexpr T max(initializer_list<T> r);
82
  template<class T, class Compare>
83
  constexpr T max(initializer_list<T> r, Compare comp);
 
95
  *Preconditions:* `ranges::distance(r) > 0`. For the overloads in
96
  namespace `std`, `T` meets the *Cpp17CopyConstructible* requirements.
97
  For the first form, `T` meets the *Cpp17LessThanComparable* requirements
98
  ([[cpp17.lessthancomparable]]).
99
 
100
+ *Returns:* The largest value in the input range. Returns a copy of the
101
+ leftmost element when several elements are equivalent to the largest.
 
 
 
 
102
 
103
  *Complexity:* Exactly `ranges::distance(r) - 1` comparisons and twice as
104
  many applications of the projection, if any.
105
 
106
+ *Remarks:* An invocation may explicitly specify an argument for the
107
+ template parameter `T` of the overloads in namespace `std`.
108
+
109
  ``` cpp
110
  template<class T>
111
  constexpr pair<const T&, const T&> minmax(const T& a, const T& b);
112
  template<class T, class Compare>
113
  constexpr pair<const T&, const T&> minmax(const T& a, const T& b, Compare comp);
 
121
  *Preconditions:* For the first form, `T` meets the
122
  *Cpp17LessThanComparable* requirements ([[cpp17.lessthancomparable]]).
123
 
124
  *Returns:* `{b, a}` if `b` is smaller than `a`, and `{a, b}` otherwise.
125
 
 
 
 
126
  *Complexity:* Exactly one comparison and two applications of the
127
  projection, if any.
128
 
129
+ *Remarks:* An invocation may explicitly specify an argument for the
130
+ template parameter `T` of the overloads in namespace `std`.
131
+
132
  ``` cpp
133
  template<class T>
134
  constexpr pair<T, T> minmax(initializer_list<T> t);
135
  template<class T, class Compare>
136
  constexpr pair<T, T> minmax(initializer_list<T> t, Compare comp);
 
153
 
154
  *Returns:* Let `X` be the return type. Returns `X{x, y}`, where `x` is a
155
  copy of the leftmost element with the smallest value and `y` a copy of
156
  the rightmost element with the largest value in the input range.
157
 
 
 
 
158
  *Complexity:* At most (3/2)`ranges::distance(r)` applications of the
159
  corresponding predicate and twice as many applications of the
160
  projection, if any.
161
 
162
+ *Remarks:* An invocation may explicitly specify an argument for the
163
+ template parameter `T` of the overloads in namespace `std`.
164
+
165
  ``` cpp
166
  template<class ForwardIterator>
167
  constexpr ForwardIterator min_element(ForwardIterator first, ForwardIterator last);
168
 
169
  template<class ExecutionPolicy, class ForwardIterator>
 
173
  template<class ForwardIterator, class Compare>
174
  constexpr ForwardIterator min_element(ForwardIterator first, ForwardIterator last,
175
  Compare comp);
176
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
177
  ForwardIterator min_element(ExecutionPolicy&& exec,
178
+ ForwardIterator first, ForwardIterator last, Compare comp);
 
179
 
180
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
181
  indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
182
  constexpr I ranges::min_element(I first, S last, Comp comp = {}, Proj proj = {});
183
  template<forward_range R, class Proj = identity,
 
257
  minmax_element(ExecutionPolicy&& exec,
258
  ForwardIterator first, ForwardIterator last, Compare comp);
259
 
260
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
261
  indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
262
+ constexpr ranges::minmax_element_result<I>
263
  ranges::minmax_element(I first, S last, Comp comp = {}, Proj proj = {});
264
  template<forward_range R, class Proj = identity,
265
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
266
+ constexpr ranges::minmax_element_result<borrowed_iterator_t<R>>
267
  ranges::minmax_element(R&& r, Comp comp = {}, Proj proj = {});
268
  ```
269
 
270
  *Returns:* `{first, first}` if \[`first`, `last`) is empty, otherwise
271
  `{m, M}`, where `m` is the first iterator in \[`first`, `last`) such
272
  that no iterator in the range refers to a smaller element, and where `M`
273
+ is the last iterator[^5]
274
+
275
+ in \[`first`, `last`) such that no iterator in the range refers to a
276
+ larger element.
277
 
278
  *Complexity:* Let N be `last - first`. At most
279
  $\max(\bigl\lfloor{\frac{3}{2}} (N-1)\bigr\rfloor, 0)$ comparisons and
280
  twice as many applications of the projection, if any.
281