- tmp/tmpfd9u414j/{from.md → to.md} +192 -15
tmp/tmpfd9u414j/{from.md → to.md}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
## Header `<algorithm>` synopsis <a id="algorithm.syn">[[algorithm.syn]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
#include <initializer_list>
|
| 5 |
|
| 6 |
namespace std {
|
| 7 |
namespace ranges {
|
| 8 |
// [algorithms.results], algorithm result types
|
| 9 |
template<class I, class F>
|
|
@@ -24,10 +24,16 @@ namespace std {
|
|
| 24 |
template<class T>
|
| 25 |
struct min_max_result;
|
| 26 |
|
| 27 |
template<class I>
|
| 28 |
struct in_found_result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
}
|
| 30 |
|
| 31 |
// [alg.nonmodifying], non-modifying sequence operations
|
| 32 |
// [alg.all.of], all of
|
| 33 |
template<class InputIterator, class Predicate>
|
|
@@ -75,10 +81,33 @@ namespace std {
|
|
| 75 |
template<input_range R, class Proj = identity,
|
| 76 |
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
|
| 77 |
constexpr bool none_of(R&& r, Pred pred, Proj proj = {});
|
| 78 |
}
|
| 79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
// [alg.foreach], for each
|
| 81 |
template<class InputIterator, class Function>
|
| 82 |
constexpr Function for_each(InputIterator first, InputIterator last, Function f);
|
| 83 |
template<class ExecutionPolicy, class ForwardIterator, class Function>
|
| 84 |
void for_each(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
|
@@ -160,10 +189,33 @@ namespace std {
|
|
| 160 |
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
|
| 161 |
constexpr borrowed_iterator_t<R>
|
| 162 |
find_if_not(R&& r, Pred pred, Proj proj = {});
|
| 163 |
}
|
| 164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
// [alg.find.end], find end
|
| 166 |
template<class ForwardIterator1, class ForwardIterator2>
|
| 167 |
constexpr ForwardIterator1
|
| 168 |
find_end(ForwardIterator1 first1, ForwardIterator1 last1,
|
| 169 |
ForwardIterator2 first2, ForwardIterator2 last2);
|
|
@@ -225,19 +277,17 @@ namespace std {
|
|
| 225 |
|
| 226 |
namespace ranges {
|
| 227 |
template<input_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2,
|
| 228 |
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
|
| 229 |
requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
|
| 230 |
-
constexpr I1 find_first_of(I1 first1, S1 last1, I2 first2, S2 last2,
|
| 231 |
-
Pred pred = {},
|
| 232 |
Proj1 proj1 = {}, Proj2 proj2 = {});
|
| 233 |
template<input_range R1, forward_range R2,
|
| 234 |
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
|
| 235 |
requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
|
| 236 |
constexpr borrowed_iterator_t<R1>
|
| 237 |
-
find_first_of(R1&& r1, R2&& r2,
|
| 238 |
-
Pred pred = {},
|
| 239 |
Proj1 proj1 = {}, Proj2 proj2 = {});
|
| 240 |
}
|
| 241 |
|
| 242 |
// [alg.adjacent.find], adjacent find
|
| 243 |
template<class ForwardIterator>
|
|
@@ -490,12 +540,11 @@ namespace std {
|
|
| 490 |
search_n(ForwardIterator first, ForwardIterator last,
|
| 491 |
Size count, const T& value);
|
| 492 |
template<class ForwardIterator, class Size, class T, class BinaryPredicate>
|
| 493 |
constexpr ForwardIterator
|
| 494 |
search_n(ForwardIterator first, ForwardIterator last,
|
| 495 |
-
Size count, const T& value,
|
| 496 |
-
BinaryPredicate pred);
|
| 497 |
template<class ExecutionPolicy, class ForwardIterator, class Size, class T>
|
| 498 |
ForwardIterator
|
| 499 |
search_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 500 |
ForwardIterator first, ForwardIterator last,
|
| 501 |
Size count, const T& value);
|
|
@@ -524,10 +573,125 @@ namespace std {
|
|
| 524 |
|
| 525 |
template<class ForwardIterator, class Searcher>
|
| 526 |
constexpr ForwardIterator
|
| 527 |
search(ForwardIterator first, ForwardIterator last, const Searcher& searcher);
|
| 528 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 529 |
// [alg.modifying.operations], mutating sequence operations
|
| 530 |
// [alg.copy], copy
|
| 531 |
template<class InputIterator, class OutputIterator>
|
| 532 |
constexpr OutputIterator copy(InputIterator first, InputIterator last,
|
| 533 |
OutputIterator result);
|
|
@@ -1171,20 +1335,37 @@ namespace std {
|
|
| 1171 |
template<class ExecutionPolicy, class ForwardIterator>
|
| 1172 |
ForwardIterator
|
| 1173 |
shift_left(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 1174 |
ForwardIterator first, ForwardIterator last,
|
| 1175 |
typename iterator_traits<ForwardIterator>::difference_type n);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1176 |
template<class ForwardIterator>
|
| 1177 |
constexpr ForwardIterator
|
| 1178 |
shift_right(ForwardIterator first, ForwardIterator last,
|
| 1179 |
typename iterator_traits<ForwardIterator>::difference_type n);
|
| 1180 |
template<class ExecutionPolicy, class ForwardIterator>
|
| 1181 |
ForwardIterator
|
| 1182 |
shift_right(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 1183 |
ForwardIterator first, ForwardIterator last,
|
| 1184 |
typename iterator_traits<ForwardIterator>::difference_type n);
|
| 1185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1186 |
// [alg.sorting], sorting and related operations
|
| 1187 |
// [alg.sort], sorting
|
| 1188 |
template<class RandomAccessIterator>
|
| 1189 |
constexpr void sort(RandomAccessIterator first, RandomAccessIterator last);
|
| 1190 |
template<class RandomAccessIterator, class Compare>
|
|
@@ -1233,26 +1414,22 @@ namespace std {
|
|
| 1233 |
borrowed_iterator_t<R>
|
| 1234 |
stable_sort(R&& r, Comp comp = {}, Proj proj = {});
|
| 1235 |
}
|
| 1236 |
|
| 1237 |
template<class RandomAccessIterator>
|
| 1238 |
-
constexpr void partial_sort(RandomAccessIterator first,
|
| 1239 |
-
RandomAccessIterator middle,
|
| 1240 |
RandomAccessIterator last);
|
| 1241 |
template<class RandomAccessIterator, class Compare>
|
| 1242 |
-
constexpr void partial_sort(RandomAccessIterator first,
|
| 1243 |
-
RandomAccessIterator middle,
|
| 1244 |
RandomAccessIterator last, Compare comp);
|
| 1245 |
template<class ExecutionPolicy, class RandomAccessIterator>
|
| 1246 |
void partial_sort(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 1247 |
-
RandomAccessIterator first,
|
| 1248 |
-
RandomAccessIterator middle,
|
| 1249 |
RandomAccessIterator last);
|
| 1250 |
template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
|
| 1251 |
void partial_sort(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 1252 |
-
RandomAccessIterator first,
|
| 1253 |
-
RandomAccessIterator middle,
|
| 1254 |
RandomAccessIterator last, Compare comp);
|
| 1255 |
|
| 1256 |
namespace ranges {
|
| 1257 |
template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
|
| 1258 |
class Proj = identity>
|
|
|
|
| 1 |
## Header `<algorithm>` synopsis <a id="algorithm.syn">[[algorithm.syn]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
#include <initializer_list> // see [initializer.list.syn]
|
| 5 |
|
| 6 |
namespace std {
|
| 7 |
namespace ranges {
|
| 8 |
// [algorithms.results], algorithm result types
|
| 9 |
template<class I, class F>
|
|
|
|
| 24 |
template<class T>
|
| 25 |
struct min_max_result;
|
| 26 |
|
| 27 |
template<class I>
|
| 28 |
struct in_found_result;
|
| 29 |
+
|
| 30 |
+
template<class I, class T>
|
| 31 |
+
struct in_value_result;
|
| 32 |
+
|
| 33 |
+
template<class O, class T>
|
| 34 |
+
struct out_value_result;
|
| 35 |
}
|
| 36 |
|
| 37 |
// [alg.nonmodifying], non-modifying sequence operations
|
| 38 |
// [alg.all.of], all of
|
| 39 |
template<class InputIterator, class Predicate>
|
|
|
|
| 81 |
template<input_range R, class Proj = identity,
|
| 82 |
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
|
| 83 |
constexpr bool none_of(R&& r, Pred pred, Proj proj = {});
|
| 84 |
}
|
| 85 |
|
| 86 |
+
// [alg.contains], contains
|
| 87 |
+
namespace ranges {
|
| 88 |
+
template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
|
| 89 |
+
requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
|
| 90 |
+
constexpr bool contains(I first, S last, const T& value, Proj proj = {});
|
| 91 |
+
template<input_range R, class T, class Proj = identity>
|
| 92 |
+
requires
|
| 93 |
+
indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
|
| 94 |
+
constexpr bool contains(R&& r, const T& value, Proj proj = {});
|
| 95 |
+
|
| 96 |
+
template<forward_iterator I1, sentinel_for<I1> S1,
|
| 97 |
+
forward_iterator I2, sentinel_for<I2> S2,
|
| 98 |
+
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
|
| 99 |
+
requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
|
| 100 |
+
constexpr bool contains_subrange(I1 first1, S1 last1, I2 first2, S2 last2,
|
| 101 |
+
Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
|
| 102 |
+
template<forward_range R1, forward_range R2,
|
| 103 |
+
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
|
| 104 |
+
requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
|
| 105 |
+
constexpr bool contains_subrange(R1&& r1, R2&& r2,
|
| 106 |
+
Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
// [alg.foreach], for each
|
| 110 |
template<class InputIterator, class Function>
|
| 111 |
constexpr Function for_each(InputIterator first, InputIterator last, Function f);
|
| 112 |
template<class ExecutionPolicy, class ForwardIterator, class Function>
|
| 113 |
void for_each(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
|
|
|
| 189 |
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
|
| 190 |
constexpr borrowed_iterator_t<R>
|
| 191 |
find_if_not(R&& r, Pred pred, Proj proj = {});
|
| 192 |
}
|
| 193 |
|
| 194 |
+
// [alg.find.last], find last
|
| 195 |
+
namespace ranges {
|
| 196 |
+
template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity>
|
| 197 |
+
requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
|
| 198 |
+
constexpr subrange<I> find_last(I first, S last, const T& value, Proj proj = {});
|
| 199 |
+
template<forward_range R, class T, class Proj = identity>
|
| 200 |
+
requires
|
| 201 |
+
indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
|
| 202 |
+
constexpr borrowed_subrange_t<R> find_last(R&& r, const T& value, Proj proj = {});
|
| 203 |
+
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
|
| 204 |
+
indirect_unary_predicate<projected<I, Proj>> Pred>
|
| 205 |
+
constexpr subrange<I> find_last_if(I first, S last, Pred pred, Proj proj = {});
|
| 206 |
+
template<forward_range R, class Proj = identity,
|
| 207 |
+
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
|
| 208 |
+
constexpr borrowed_subrange_t<R> find_last_if(R&& r, Pred pred, Proj proj = {});
|
| 209 |
+
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
|
| 210 |
+
indirect_unary_predicate<projected<I, Proj>> Pred>
|
| 211 |
+
constexpr subrange<I> find_last_if_not(I first, S last, Pred pred, Proj proj = {});
|
| 212 |
+
template<forward_range R, class Proj = identity,
|
| 213 |
+
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
|
| 214 |
+
constexpr borrowed_subrange_t<R> find_last_if_not(R&& r, Pred pred, Proj proj = {});
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
// [alg.find.end], find end
|
| 218 |
template<class ForwardIterator1, class ForwardIterator2>
|
| 219 |
constexpr ForwardIterator1
|
| 220 |
find_end(ForwardIterator1 first1, ForwardIterator1 last1,
|
| 221 |
ForwardIterator2 first2, ForwardIterator2 last2);
|
|
|
|
| 277 |
|
| 278 |
namespace ranges {
|
| 279 |
template<input_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2,
|
| 280 |
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
|
| 281 |
requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
|
| 282 |
+
constexpr I1 find_first_of(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
|
|
|
|
| 283 |
Proj1 proj1 = {}, Proj2 proj2 = {});
|
| 284 |
template<input_range R1, forward_range R2,
|
| 285 |
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
|
| 286 |
requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
|
| 287 |
constexpr borrowed_iterator_t<R1>
|
| 288 |
+
find_first_of(R1&& r1, R2&& r2, Pred pred = {},
|
|
|
|
| 289 |
Proj1 proj1 = {}, Proj2 proj2 = {});
|
| 290 |
}
|
| 291 |
|
| 292 |
// [alg.adjacent.find], adjacent find
|
| 293 |
template<class ForwardIterator>
|
|
|
|
| 540 |
search_n(ForwardIterator first, ForwardIterator last,
|
| 541 |
Size count, const T& value);
|
| 542 |
template<class ForwardIterator, class Size, class T, class BinaryPredicate>
|
| 543 |
constexpr ForwardIterator
|
| 544 |
search_n(ForwardIterator first, ForwardIterator last,
|
| 545 |
+
Size count, const T& value, BinaryPredicate pred);
|
|
|
|
| 546 |
template<class ExecutionPolicy, class ForwardIterator, class Size, class T>
|
| 547 |
ForwardIterator
|
| 548 |
search_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 549 |
ForwardIterator first, ForwardIterator last,
|
| 550 |
Size count, const T& value);
|
|
|
|
| 573 |
|
| 574 |
template<class ForwardIterator, class Searcher>
|
| 575 |
constexpr ForwardIterator
|
| 576 |
search(ForwardIterator first, ForwardIterator last, const Searcher& searcher);
|
| 577 |
|
| 578 |
+
namespace ranges {
|
| 579 |
+
// [alg.starts.with], starts with
|
| 580 |
+
template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
|
| 581 |
+
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
|
| 582 |
+
requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
|
| 583 |
+
constexpr bool starts_with(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
|
| 584 |
+
Proj1 proj1 = {}, Proj2 proj2 = {});
|
| 585 |
+
template<input_range R1, input_range R2, class Pred = ranges::equal_to,
|
| 586 |
+
class Proj1 = identity, class Proj2 = identity>
|
| 587 |
+
requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
|
| 588 |
+
constexpr bool starts_with(R1&& r1, R2&& r2, Pred pred = {},
|
| 589 |
+
Proj1 proj1 = {}, Proj2 proj2 = {});
|
| 590 |
+
|
| 591 |
+
// [alg.ends.with], ends with
|
| 592 |
+
template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
|
| 593 |
+
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
|
| 594 |
+
requires (forward_iterator<I1> || sized_sentinel_for<S1, I1>) &&
|
| 595 |
+
(forward_iterator<I2> || sized_sentinel_for<S2, I2>) &&
|
| 596 |
+
indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
|
| 597 |
+
constexpr bool ends_with(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
|
| 598 |
+
Proj1 proj1 = {}, Proj2 proj2 = {});
|
| 599 |
+
template<input_range R1, input_range R2, class Pred = ranges::equal_to,
|
| 600 |
+
class Proj1 = identity, class Proj2 = identity>
|
| 601 |
+
requires (forward_range<R1> || sized_range<R1>) &&
|
| 602 |
+
(forward_range<R2> || sized_range<R2>) &&
|
| 603 |
+
indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
|
| 604 |
+
constexpr bool ends_with(R1&& r1, R2&& r2, Pred pred = {},
|
| 605 |
+
Proj1 proj1 = {}, Proj2 proj2 = {});
|
| 606 |
+
|
| 607 |
+
// [alg.fold], fold
|
| 608 |
+
template<class F>
|
| 609 |
+
class flipped { // exposition only
|
| 610 |
+
F f; // exposition only
|
| 611 |
+
|
| 612 |
+
public:
|
| 613 |
+
template<class T, class U> requires invocable<F&, U, T>
|
| 614 |
+
invoke_result_t<F&, U, T> operator()(T&&, U&&);
|
| 615 |
+
};
|
| 616 |
+
|
| 617 |
+
template<class F, class T, class I, class U>
|
| 618 |
+
concept indirectly-binary-left-foldable-impl = // exposition only
|
| 619 |
+
movable<T> && movable<U> &&
|
| 620 |
+
convertible_to<T, U> && invocable<F&, U, iter_reference_t<I>> &&
|
| 621 |
+
assignable_from<U&, invoke_result_t<F&, U, iter_reference_t<I>>>;
|
| 622 |
+
|
| 623 |
+
template<class F, class T, class I>
|
| 624 |
+
concept indirectly-binary-left-foldable = // exposition only
|
| 625 |
+
copy_constructible<F> && indirectly_readable<I> &&
|
| 626 |
+
invocable<F&, T, iter_reference_t<I>> &&
|
| 627 |
+
convertible_to<invoke_result_t<F&, T, iter_reference_t<I>>,
|
| 628 |
+
decay_t<invoke_result_t<F&, T, iter_reference_t<I>>>> &&
|
| 629 |
+
indirectly-binary-left-foldable-impl<F, T, I,
|
| 630 |
+
decay_t<invoke_result_t<F&, T, iter_reference_t<I>>>>;
|
| 631 |
+
|
| 632 |
+
template<class F, class T, class I>
|
| 633 |
+
concept indirectly-binary-right-foldable = // exposition only
|
| 634 |
+
indirectly-binary-left-foldable<flipped<F>, T, I>;
|
| 635 |
+
|
| 636 |
+
template<input_iterator I, sentinel_for<I> S, class T,
|
| 637 |
+
indirectly-binary-left-foldable<T, I> F>
|
| 638 |
+
constexpr auto fold_left(I first, S last, T init, F f);
|
| 639 |
+
|
| 640 |
+
template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F>
|
| 641 |
+
constexpr auto fold_left(R&& r, T init, F f);
|
| 642 |
+
|
| 643 |
+
template<input_iterator I, sentinel_for<I> S,
|
| 644 |
+
indirectly-binary-left-foldable<iter_value_t<I>, I> F>
|
| 645 |
+
requires constructible_from<iter_value_t<I>, iter_reference_t<I>>
|
| 646 |
+
constexpr auto fold_left_first(I first, S last, F f);
|
| 647 |
+
|
| 648 |
+
template<input_range R, indirectly-binary-left-foldable<range_value_t<R>, iterator_t<R>> F>
|
| 649 |
+
requires constructible_from<range_value_t<R>, range_reference_t<R>>
|
| 650 |
+
constexpr auto fold_left_first(R&& r, F f);
|
| 651 |
+
|
| 652 |
+
template<bidirectional_iterator I, sentinel_for<I> S, class T,
|
| 653 |
+
indirectly-binary-right-foldable<T, I> F>
|
| 654 |
+
constexpr auto fold_right(I first, S last, T init, F f);
|
| 655 |
+
|
| 656 |
+
template<bidirectional_range R, class T,
|
| 657 |
+
indirectly-binary-right-foldable<T, iterator_t<R>> F>
|
| 658 |
+
constexpr auto fold_right(R&& r, T init, F f);
|
| 659 |
+
|
| 660 |
+
template<bidirectional_iterator I, sentinel_for<I> S,
|
| 661 |
+
indirectly-binary-right-foldable<iter_value_t<I>, I> F>
|
| 662 |
+
requires constructible_from<iter_value_t<I>, iter_reference_t<I>>
|
| 663 |
+
constexpr auto fold_right_last(I first, S last, F f);
|
| 664 |
+
|
| 665 |
+
template<bidirectional_range R,
|
| 666 |
+
indirectly-binary-right-foldable<range_value_t<R>, iterator_t<R>> F>
|
| 667 |
+
requires constructible_from<range_value_t<R>, range_reference_t<R>>
|
| 668 |
+
constexpr auto fold_right_last(R&& r, F f);
|
| 669 |
+
|
| 670 |
+
template<class I, class T>
|
| 671 |
+
using fold_left_with_iter_result = in_value_result<I, T>;
|
| 672 |
+
template<class I, class T>
|
| 673 |
+
using fold_left_first_with_iter_result = in_value_result<I, T>;
|
| 674 |
+
|
| 675 |
+
template<input_iterator I, sentinel_for<I> S, class T,
|
| 676 |
+
indirectly-binary-left-foldable<T, I> F>
|
| 677 |
+
constexpr see below fold_left_with_iter(I first, S last, T init, F f);
|
| 678 |
+
|
| 679 |
+
template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F>
|
| 680 |
+
constexpr see below fold_left_with_iter(R&& r, T init, F f);
|
| 681 |
+
|
| 682 |
+
template<input_iterator I, sentinel_for<I> S,
|
| 683 |
+
indirectly-binary-left-foldable<iter_value_t<I>, I> F>
|
| 684 |
+
requires constructible_from<iter_value_t<I>, iter_reference_t<I>>
|
| 685 |
+
constexpr see below fold_left_first_with_iter(I first, S last, F f);
|
| 686 |
+
|
| 687 |
+
template<input_range R,
|
| 688 |
+
indirectly-binary-left-foldable<range_value_t<R>, iterator_t<R>> F>
|
| 689 |
+
requires constructible_from<range_value_t<R>, range_reference_t<R>>
|
| 690 |
+
constexpr see below fold_left_first_with_iter(R&& r, F f);
|
| 691 |
+
}
|
| 692 |
+
|
| 693 |
// [alg.modifying.operations], mutating sequence operations
|
| 694 |
// [alg.copy], copy
|
| 695 |
template<class InputIterator, class OutputIterator>
|
| 696 |
constexpr OutputIterator copy(InputIterator first, InputIterator last,
|
| 697 |
OutputIterator result);
|
|
|
|
| 1335 |
template<class ExecutionPolicy, class ForwardIterator>
|
| 1336 |
ForwardIterator
|
| 1337 |
shift_left(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 1338 |
ForwardIterator first, ForwardIterator last,
|
| 1339 |
typename iterator_traits<ForwardIterator>::difference_type n);
|
| 1340 |
+
|
| 1341 |
+
namespace ranges {
|
| 1342 |
+
template<permutable I, sentinel_for<I> S>
|
| 1343 |
+
constexpr subrange<I> shift_left(I first, S last, iter_difference_t<I> n);
|
| 1344 |
+
template<forward_range R>
|
| 1345 |
+
requires permutable<iterator_t<R>>
|
| 1346 |
+
constexpr borrowed_subrange_t<R> shift_left(R&& r, range_difference_t<R> n);
|
| 1347 |
+
}
|
| 1348 |
+
|
| 1349 |
template<class ForwardIterator>
|
| 1350 |
constexpr ForwardIterator
|
| 1351 |
shift_right(ForwardIterator first, ForwardIterator last,
|
| 1352 |
typename iterator_traits<ForwardIterator>::difference_type n);
|
| 1353 |
template<class ExecutionPolicy, class ForwardIterator>
|
| 1354 |
ForwardIterator
|
| 1355 |
shift_right(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 1356 |
ForwardIterator first, ForwardIterator last,
|
| 1357 |
typename iterator_traits<ForwardIterator>::difference_type n);
|
| 1358 |
|
| 1359 |
+
namespace ranges {
|
| 1360 |
+
template<permutable I, sentinel_for<I> S>
|
| 1361 |
+
constexpr subrange<I> shift_right(I first, S last, iter_difference_t<I> n);
|
| 1362 |
+
template<forward_range R>
|
| 1363 |
+
requires permutable<iterator_t<R>>
|
| 1364 |
+
constexpr borrowed_subrange_t<R> shift_right(R&& r, range_difference_t<R> n);
|
| 1365 |
+
}
|
| 1366 |
+
|
| 1367 |
// [alg.sorting], sorting and related operations
|
| 1368 |
// [alg.sort], sorting
|
| 1369 |
template<class RandomAccessIterator>
|
| 1370 |
constexpr void sort(RandomAccessIterator first, RandomAccessIterator last);
|
| 1371 |
template<class RandomAccessIterator, class Compare>
|
|
|
|
| 1414 |
borrowed_iterator_t<R>
|
| 1415 |
stable_sort(R&& r, Comp comp = {}, Proj proj = {});
|
| 1416 |
}
|
| 1417 |
|
| 1418 |
template<class RandomAccessIterator>
|
| 1419 |
+
constexpr void partial_sort(RandomAccessIterator first, RandomAccessIterator middle,
|
|
|
|
| 1420 |
RandomAccessIterator last);
|
| 1421 |
template<class RandomAccessIterator, class Compare>
|
| 1422 |
+
constexpr void partial_sort(RandomAccessIterator first, RandomAccessIterator middle,
|
|
|
|
| 1423 |
RandomAccessIterator last, Compare comp);
|
| 1424 |
template<class ExecutionPolicy, class RandomAccessIterator>
|
| 1425 |
void partial_sort(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 1426 |
+
RandomAccessIterator first, RandomAccessIterator middle,
|
|
|
|
| 1427 |
RandomAccessIterator last);
|
| 1428 |
template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
|
| 1429 |
void partial_sort(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 1430 |
+
RandomAccessIterator first, RandomAccessIterator middle,
|
|
|
|
| 1431 |
RandomAccessIterator last, Compare comp);
|
| 1432 |
|
| 1433 |
namespace ranges {
|
| 1434 |
template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
|
| 1435 |
class Proj = identity>
|