Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1 | // -*- C++ -*- |
Louis Dionne | eb8650a | 2021-11-17 21:25:01 | [diff] [blame] | 2 | //===----------------------------------------------------------------------===// |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 3 | // |
Chandler Carruth | 57b08b0 | 2019-01-19 10:56:40 | [diff] [blame] | 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef _LIBCPP_ALGORITHM |
| 11 | #define _LIBCPP_ALGORITHM |
| 12 | |
| 13 | /* |
| 14 | algorithm synopsis |
| 15 | |
| 16 | #include <initializer_list> |
| 17 | |
| 18 | namespace std |
| 19 | { |
| 20 | |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 21 | namespace ranges { |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 22 | |
| 23 | // [algorithms.results], algorithm result types |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 24 | template <class I, class F> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 25 | struct in_fun_result; // since C++20 |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 26 | |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 27 | template <class I1, class I2> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 28 | struct in_in_result; // since C++20 |
Nikolas Klauser | f3514af | 2022-01-25 10:21:47 | [diff] [blame] | 29 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 30 | template <class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 31 | struct in_out_result; // since C++20 |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 32 | |
Nikolas Klauser | f3514af | 2022-01-25 10:21:47 | [diff] [blame] | 33 | template <class I1, class I2, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 34 | struct in_in_out_result; // since C++20 |
Nikolas Klauser | 610979b | 2022-02-03 01:17:03 | [diff] [blame] | 35 | |
| 36 | template <class I, class O1, class O2> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 37 | struct in_out_out_result; // since C++20 |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 38 | |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 39 | template <class I1, class I2> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 40 | struct min_max_result; // since C++20 |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 41 | |
Nikolas Klauser | 68f4131 | 2022-02-21 22:07:02 | [diff] [blame] | 42 | template <class I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 43 | struct in_found_result; // since C++20 |
Nikolas Klauser | 68f4131 | 2022-02-21 22:07:02 | [diff] [blame] | 44 | |
Christopher Di Bella | 3903438 | 2023-12-20 05:57:50 | [diff] [blame^] | 45 | template <class I, class T> |
| 46 | struct in_value_result; // since C++23 |
| 47 | |
Nikolas Klauser | 3b470d1 | 2022-02-11 12:11:57 | [diff] [blame] | 48 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 49 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> // since C++20 |
Nikolas Klauser | 3b470d1 | 2022-02-11 12:11:57 | [diff] [blame] | 50 | constexpr I min_element(I first, S last, Comp comp = {}, Proj proj = {}); |
| 51 | |
| 52 | template<forward_range R, class Proj = identity, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 53 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> // since C++20 |
Nikolas Klauser | 3b470d1 | 2022-02-11 12:11:57 | [diff] [blame] | 54 | constexpr borrowed_iterator_t<R> min_element(R&& r, Comp comp = {}, Proj proj = {}); |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 55 | |
Nikolas Klauser | 40f7fca3 | 2022-05-22 11:43:37 | [diff] [blame] | 56 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 57 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 58 | constexpr I ranges::max_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 40f7fca3 | 2022-05-22 11:43:37 | [diff] [blame] | 59 | |
| 60 | template<forward_range R, class Proj = identity, |
| 61 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 62 | constexpr borrowed_iterator_t<R> ranges::max_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 40f7fca3 | 2022-05-22 11:43:37 | [diff] [blame] | 63 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 64 | template<class I1, class I2> |
| 65 | using mismatch_result = in_in_result<I1, I2>; |
| 66 | |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 67 | template <input_iterator I1, sentinel_for<_I1> S1, input_iterator I2, sentinel_for<_I2> S2, |
| 68 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 69 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 70 | constexpr mismatch_result<_I1, _I2> // since C++20 |
| 71 | mismatch()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 72 | |
| 73 | template <input_range R1, input_range R2, |
| 74 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 75 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 76 | constexpr mismatch_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 77 | mismatch(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 78 | |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 79 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 80 | constexpr I find(I first, S last, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 81 | |
| 82 | template<input_range R, class T, class Proj = identity> |
| 83 | requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 84 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 85 | find(R&& r, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 86 | |
| 87 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 88 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 89 | constexpr I find_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 90 | |
| 91 | template<input_range R, class Proj = identity, |
| 92 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 93 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 94 | find_if(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 95 | |
| 96 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 97 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 98 | constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 99 | |
| 100 | template<input_range R, class Proj = identity, |
| 101 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 102 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 103 | find_if_not(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | f83d833 | 2022-03-18 01:57:08 | [diff] [blame] | 104 | |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 105 | template<class T, class Proj = identity, |
| 106 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 107 | constexpr const T& min(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | f83d833 | 2022-03-18 01:57:08 | [diff] [blame] | 108 | |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 109 | template<copyable T, class Proj = identity, |
| 110 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 111 | constexpr T min(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | f83d833 | 2022-03-18 01:57:08 | [diff] [blame] | 112 | |
| 113 | template<input_range R, class Proj = identity, |
| 114 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 115 | requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> |
| 116 | constexpr range_value_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 117 | min(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 118 | |
| 119 | template<class T, class Proj = identity, |
| 120 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 121 | constexpr const T& max(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 122 | |
| 123 | template<copyable T, class Proj = identity, |
| 124 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 125 | constexpr T max(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 126 | |
| 127 | template<input_range R, class Proj = identity, |
| 128 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 129 | requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> |
| 130 | constexpr range_value_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 131 | max(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 132 | |
| 133 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 134 | using unary_transform_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 135 | |
| 136 | template<class I1, class I2, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 137 | using binary_transform_result = in_in_out_result<I1, I2, O>; // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 138 | |
| 139 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, |
| 140 | copy_constructible F, class Proj = identity> |
| 141 | requires indirectly_writable<O, indirect_result_t<F&, projected<I, Proj>>> |
| 142 | constexpr ranges::unary_transform_result<I, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 143 | transform(I first1, S last1, O result, F op, Proj proj = {}); // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 144 | |
| 145 | template<input_range R, weakly_incrementable O, copy_constructible F, |
| 146 | class Proj = identity> |
| 147 | requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R>, Proj>>> |
| 148 | constexpr ranges::unary_transform_result<borrowed_iterator_t<R>, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 149 | transform(R&& r, O result, F op, Proj proj = {}); // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 150 | |
| 151 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 152 | weakly_incrementable O, copy_constructible F, class Proj1 = identity, |
| 153 | class Proj2 = identity> |
| 154 | requires indirectly_writable<O, indirect_result_t<F&, projected<I1, Proj1>, |
| 155 | projected<I2, Proj2>>> |
| 156 | constexpr ranges::binary_transform_result<I1, I2, O> |
| 157 | transform(I1 first1, S1 last1, I2 first2, S2 last2, O result, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 158 | F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 159 | |
| 160 | template<input_range R1, input_range R2, weakly_incrementable O, |
| 161 | copy_constructible F, class Proj1 = identity, class Proj2 = identity> |
| 162 | requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R1>, Proj1>, |
| 163 | projected<iterator_t<R2>, Proj2>>> |
| 164 | constexpr ranges::binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> |
| 165 | transform(R1&& r1, R2&& r2, O result, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 166 | F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 1306b10 | 2022-04-07 11:02:02 | [diff] [blame] | 167 | |
| 168 | template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity> |
| 169 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 170 | constexpr iter_difference_t<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 171 | count(I first, S last, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | 1306b10 | 2022-04-07 11:02:02 | [diff] [blame] | 172 | |
| 173 | template<input_range R, class T, class Proj = identity> |
| 174 | requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 175 | constexpr range_difference_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 176 | count(R&& r, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | 1306b10 | 2022-04-07 11:02:02 | [diff] [blame] | 177 | |
| 178 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 179 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 180 | constexpr iter_difference_t<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 181 | count_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 1306b10 | 2022-04-07 11:02:02 | [diff] [blame] | 182 | |
| 183 | template<input_range R, class Proj = identity, |
| 184 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 185 | constexpr range_difference_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 186 | count_if(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 187 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 188 | template<class T> |
| 189 | using minmax_result = min_max_result<T>; |
| 190 | |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 191 | template<class T, class Proj = identity, |
| 192 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 193 | constexpr ranges::minmax_result<const T&> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 194 | minmax(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 195 | |
| 196 | template<copyable T, class Proj = identity, |
| 197 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 198 | constexpr ranges::minmax_result<T> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 199 | minmax(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 200 | |
| 201 | template<input_range R, class Proj = identity, |
| 202 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 203 | requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> |
| 204 | constexpr ranges::minmax_result<range_value_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 205 | minmax(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 206 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 207 | template<class I> |
| 208 | using minmax_element_result = min_max_result<I>; |
| 209 | |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 210 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 211 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
| 212 | constexpr ranges::minmax_element_result<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 213 | minmax_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 214 | |
| 215 | template<forward_range R, class Proj = identity, |
| 216 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 217 | constexpr ranges::minmax_element_result<borrowed_iterator_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 218 | minmax_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 219 | |
| 220 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 221 | using copy_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 222 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 223 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 224 | using copy_n_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 225 | |
| 226 | template<class I, class O> |
| 227 | using copy_if_result = in_out_result<I, O>; // since C++20 |
| 228 | |
| 229 | template<class I1, class I2> |
| 230 | using copy_backward_result = in_out_result<I1, I2>; // since C++20 |
| 231 | |
ZijunZhaoCCK | fdd089b | 2023-12-20 00:34:19 | [diff] [blame] | 232 | template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity> |
| 233 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 234 | constexpr bool ranges::contains(I first, S last, const T& value, Proj proj = {}); // since C++23 |
| 235 | |
| 236 | template<input_range R, class T, class Proj = identity> |
| 237 | requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 238 | constexpr bool ranges::contains(R&& r, const T& value, Proj proj = {}); // since C++23 |
| 239 | |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 240 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O> |
| 241 | requires indirectly_copyable<I, O> |
| 242 | constexpr ranges::copy_result<I, O> ranges::copy(I first, S last, O result); // since C++20 |
| 243 | |
| 244 | template<input_range R, weakly_incrementable O> |
| 245 | requires indirectly_copyable<iterator_t<R>, O> |
| 246 | constexpr ranges::copy_result<borrowed_iterator_t<R>, O> ranges::copy(R&& r, O result); // since C++20 |
| 247 | |
| 248 | template<input_iterator I, weakly_incrementable O> |
| 249 | requires indirectly_copyable<I, O> |
| 250 | constexpr ranges::copy_n_result<I, O> |
| 251 | ranges::copy_n(I first, iter_difference_t<I> n, O result); // since C++20 |
| 252 | |
| 253 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Proj = identity, |
| 254 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 255 | requires indirectly_copyable<I, O> |
| 256 | constexpr ranges::copy_if_result<I, O> |
| 257 | ranges::copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // since C++20 |
| 258 | |
| 259 | template<input_range R, weakly_incrementable O, class Proj = identity, |
| 260 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 261 | requires indirectly_copyable<iterator_t<R>, O> |
| 262 | constexpr ranges::copy_if_result<borrowed_iterator_t<R>, O> |
| 263 | ranges::copy_if(R&& r, O result, Pred pred, Proj proj = {}); // since C++20 |
| 264 | |
| 265 | template<bidirectional_iterator I1, sentinel_for<I1> S1, bidirectional_iterator I2> |
| 266 | requires indirectly_copyable<I1, I2> |
| 267 | constexpr ranges::copy_backward_result<I1, I2> |
| 268 | ranges::copy_backward(I1 first, S1 last, I2 result); // since C++20 |
| 269 | |
| 270 | template<bidirectional_range R, bidirectional_iterator I> |
| 271 | requires indirectly_copyable<iterator_t<R>, I> |
| 272 | constexpr ranges::copy_backward_result<borrowed_iterator_t<R>, I> |
| 273 | ranges::copy_backward(R&& r, I result); // since C++20 |
Nikolas Klauser | 80045e9 | 2022-05-04 18:27:07 | [diff] [blame] | 274 | |
| 275 | template<class I, class F> |
| 276 | using for_each_result = in_fun_result<I, F>; // since C++20 |
| 277 | |
| 278 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 279 | indirectly_unary_invocable<projected<I, Proj>> Fun> |
| 280 | constexpr ranges::for_each_result<I, Fun> |
| 281 | ranges::for_each(I first, S last, Fun f, Proj proj = {}); // since C++20 |
| 282 | |
| 283 | template<input_range R, class Proj = identity, |
| 284 | indirectly_unary_invocable<projected<iterator_t<R>, Proj>> Fun> |
| 285 | constexpr ranges::for_each_result<borrowed_iterator_t<R>, Fun> |
| 286 | ranges::for_each(R&& r, Fun f, Proj proj = {}); // since C++20 |
| 287 | |
| 288 | template<input_iterator I, class Proj = identity, |
| 289 | indirectly_unary_invocable<projected<I, Proj>> Fun> |
| 290 | constexpr ranges::for_each_n_result<I, Fun> |
| 291 | ranges::for_each_n(I first, iter_difference_t<I> n, Fun f, Proj proj = {}); // since C++20 |
Nikolas Klauser | 37ba1b9 | 2022-05-04 12:19:09 | [diff] [blame] | 292 | |
| 293 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 294 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 295 | constexpr bool ranges::is_partitioned(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 296 | |
| 297 | template<input_range R, class Proj = identity, |
| 298 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 299 | constexpr bool ranges::is_partitioned(R&& r, Pred pred, Proj proj = {}); // since C++20 |
| 300 | |
Konstantin Varlamov | c945bd0 | 2022-07-08 20:46:27 | [diff] [blame] | 301 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 302 | class Proj = identity> |
| 303 | requires sortable<I, Comp, Proj> |
| 304 | constexpr I |
| 305 | ranges::push_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 306 | |
| 307 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 308 | requires sortable<iterator_t<R>, Comp, Proj> |
| 309 | constexpr borrowed_iterator_t<R> |
| 310 | ranges::push_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 311 | |
| 312 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 313 | class Proj = identity> |
| 314 | requires sortable<I, Comp, Proj> |
| 315 | constexpr I |
| 316 | ranges::pop_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 317 | |
| 318 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 319 | requires sortable<iterator_t<R>, Comp, Proj> |
| 320 | constexpr borrowed_iterator_t<R> |
| 321 | ranges::pop_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 322 | |
| 323 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 324 | class Proj = identity> |
| 325 | requires sortable<I, Comp, Proj> |
| 326 | constexpr I |
| 327 | ranges::make_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 328 | |
| 329 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 330 | requires sortable<iterator_t<R>, Comp, Proj> |
| 331 | constexpr borrowed_iterator_t<R> |
| 332 | ranges::make_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 333 | |
| 334 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 335 | class Proj = identity> |
| 336 | requires sortable<I, Comp, Proj> |
| 337 | constexpr I |
| 338 | ranges::sort_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 339 | |
| 340 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 341 | requires sortable<iterator_t<R>, Comp, Proj> |
| 342 | constexpr borrowed_iterator_t<R> |
| 343 | ranges::sort_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 344 | |
Konstantin Varlamov | d406c64 | 2022-07-26 23:11:09 | [diff] [blame] | 345 | template<random_access_iterator I, sentinel_for<I> S, class Proj = identity, |
| 346 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 347 | constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | d406c64 | 2022-07-26 23:11:09 | [diff] [blame] | 348 | |
| 349 | template<random_access_range R, class Proj = identity, |
| 350 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 351 | constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | d406c64 | 2022-07-26 23:11:09 | [diff] [blame] | 352 | |
| 353 | template<random_access_iterator I, sentinel_for<I> S, class Proj = identity, |
| 354 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 355 | constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | d406c64 | 2022-07-26 23:11:09 | [diff] [blame] | 356 | |
| 357 | template<random_access_range R, class Proj = identity, |
| 358 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 359 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 360 | is_heap_until(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | d406c64 | 2022-07-26 23:11:09 | [diff] [blame] | 361 | |
Nikolas Klauser | 1d1a191 | 2022-05-24 08:32:50 | [diff] [blame] | 362 | template<bidirectional_iterator I, sentinel_for<I> S> |
| 363 | requires permutable<I> |
| 364 | constexpr I ranges::reverse(I first, S last); // since C++20 |
| 365 | |
| 366 | template<bidirectional_range R> |
| 367 | requires permutable<iterator_t<R>> |
| 368 | constexpr borrowed_iterator_t<R> ranges::reverse(R&& r); // since C++20 |
| 369 | |
Konstantin Varlamov | ff3989e | 2022-06-16 22:20:53 | [diff] [blame] | 370 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 371 | class Proj = identity> |
| 372 | requires sortable<I, Comp, Proj> |
| 373 | constexpr I |
Konstantin Varlamov | 94c7b89 | 2022-07-01 23:34:08 | [diff] [blame] | 374 | ranges::sort(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | ff3989e | 2022-06-16 22:20:53 | [diff] [blame] | 375 | |
| 376 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 377 | requires sortable<iterator_t<R>, Comp, Proj> |
| 378 | constexpr borrowed_iterator_t<R> |
Konstantin Varlamov | 94c7b89 | 2022-07-01 23:34:08 | [diff] [blame] | 379 | ranges::sort(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 380 | |
| 381 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 382 | class Proj = identity> |
| 383 | requires sortable<I, Comp, Proj> |
| 384 | I ranges::stable_sort(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 385 | |
| 386 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 387 | requires sortable<iterator_t<R>, Comp, Proj> |
| 388 | borrowed_iterator_t<R> |
| 389 | ranges::stable_sort(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | ff3989e | 2022-06-16 22:20:53 | [diff] [blame] | 390 | |
varconst | 5dd19ad | 2022-07-20 03:10:02 | [diff] [blame] | 391 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 392 | class Proj = identity> |
| 393 | requires sortable<I, Comp, Proj> |
| 394 | constexpr I |
| 395 | ranges::partial_sort(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 396 | |
| 397 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 398 | requires sortable<iterator_t<R>, Comp, Proj> |
| 399 | constexpr borrowed_iterator_t<R> |
| 400 | ranges::partial_sort(R&& r, iterator_t<R> middle, Comp comp = {}, Proj proj = {}); // since C++20 |
| 401 | |
Nikolas Klauser | 7af89a3 | 2022-05-21 16:26:29 | [diff] [blame] | 402 | template<class T, output_iterator<const T&> O, sentinel_for<O> S> |
| 403 | constexpr O ranges::fill(O first, S last, const T& value); // since C++20 |
| 404 | |
| 405 | template<class T, output_range<const T&> R> |
| 406 | constexpr borrowed_iterator_t<R> ranges::fill(R&& r, const T& value); // since C++20 |
| 407 | |
| 408 | template<class T, output_iterator<const T&> O> |
| 409 | constexpr O ranges::fill_n(O first, iter_difference_t<O> n, const T& value); // since C++20 |
Nikolas Klauser | 569d663 | 2022-05-25 09:09:43 | [diff] [blame] | 410 | |
Konstantin Varlamov | ead7302 | 2022-07-26 22:50:14 | [diff] [blame] | 411 | template<input_or_output_iterator O, sentinel_for<O> S, copy_constructible F> |
| 412 | requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 413 | constexpr O generate(O first, S last, F gen); // since C++20 |
Konstantin Varlamov | ead7302 | 2022-07-26 22:50:14 | [diff] [blame] | 414 | |
Nikolas Klauser | cd91610 | 2023-06-09 20:45:34 | [diff] [blame] | 415 | template<class ExecutionPolicy, class ForwardIterator, class Generator> |
| 416 | void generate(ExecutionPolicy&& exec, |
| 417 | ForwardIterator first, ForwardIterator last, |
| 418 | Generator gen); // since C++17 |
| 419 | |
Konstantin Varlamov | ead7302 | 2022-07-26 22:50:14 | [diff] [blame] | 420 | template<class R, copy_constructible F> |
| 421 | requires invocable<F&> && output_range<R, invoke_result_t<F&>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 422 | constexpr borrowed_iterator_t<R> generate(R&& r, F gen); // since C++20 |
Konstantin Varlamov | ead7302 | 2022-07-26 22:50:14 | [diff] [blame] | 423 | |
| 424 | template<input_or_output_iterator O, copy_constructible F> |
| 425 | requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 426 | constexpr O generate_n(O first, iter_difference_t<O> n, F gen); // since C++20 |
Konstantin Varlamov | ead7302 | 2022-07-26 22:50:14 | [diff] [blame] | 427 | |
Nikolas Klauser | cd91610 | 2023-06-09 20:45:34 | [diff] [blame] | 428 | template<class ExecutionPolicy, class ForwardIterator, class Size, class Generator> |
| 429 | ForwardIterator generate_n(ExecutionPolicy&& exec, |
| 430 | ForwardIterator first, Size n, Generator gen); // since C++17 |
| 431 | |
Nikolas Klauser | 569d663 | 2022-05-25 09:09:43 | [diff] [blame] | 432 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 433 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 434 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 435 | constexpr bool ranges::equal(I1 first1, S1 last1, I2 first2, S2 last2, |
| 436 | Pred pred = {}, |
| 437 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 438 | |
| 439 | template<input_range R1, input_range R2, class Pred = ranges::equal_to, |
| 440 | class Proj1 = identity, class Proj2 = identity> |
| 441 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 442 | constexpr bool ranges::equal(R1&& r1, R2&& r2, Pred pred = {}, |
| 443 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 444 | |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 445 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 446 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 447 | constexpr bool ranges::all_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 448 | |
| 449 | template<input_range R, class Proj = identity, |
| 450 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 451 | constexpr bool ranges::all_of(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 452 | |
| 453 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 454 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 455 | constexpr bool ranges::any_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 456 | |
| 457 | template<input_range R, class Proj = identity, |
| 458 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 459 | constexpr bool ranges::any_of(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 460 | |
Zijun Zhao | 0218ea4 | 2023-09-18 18:28:11 | [diff] [blame] | 461 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 462 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 463 | requires (forward_iterator<I1> || sized_sentinel_for<S1, I1>) && |
| 464 | (forward_iterator<I2> || sized_sentinel_for<S2, I2>) && |
| 465 | indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 466 | constexpr bool ranges::ends_with(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, |
| 467 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23 |
| 468 | |
| 469 | template<input_range R1, input_range R2, class Pred = ranges::equal_to, class Proj1 = identity, |
| 470 | class Proj2 = identity> |
| 471 | requires (forward_range<R1> || sized_range<R1>) && |
| 472 | (forward_range<R2> || sized_range<R2>) && |
| 473 | indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 474 | constexpr bool ranges::ends_with(R1&& r1, R2&& r2, Pred pred = {}, |
| 475 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23 |
| 476 | |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 477 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 478 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 479 | constexpr bool ranges::none_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 480 | |
| 481 | template<input_range R, class Proj = identity, |
| 482 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 483 | constexpr bool ranges::none_of(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 484 | |
zijunzhao | 2051755 | 2023-05-08 22:04:00 | [diff] [blame] | 485 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 486 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 487 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 488 | constexpr bool ranges::starts_with(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, |
| 489 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23 |
| 490 | |
| 491 | template<input_range R1, input_range R2, class Pred = ranges::equal_to, class Proj1 = identity, |
| 492 | class Proj2 = identity> |
| 493 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 494 | constexpr bool ranges::starts_with(R1&& r1, R2&& r2, Pred pred = {}, |
| 495 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23 |
| 496 | |
Konstantin Varlamov | db7d795 | 2022-07-30 09:42:05 | [diff] [blame] | 497 | template<input_iterator I1, sentinel_for<I1> S1, |
| 498 | random_access_iterator I2, sentinel_for<I2> S2, |
| 499 | class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> |
| 500 | requires indirectly_copyable<I1, I2> && sortable<I2, Comp, Proj2> && |
| 501 | indirect_strict_weak_order<Comp, projected<I1, Proj1>, projected<I2, Proj2>> |
| 502 | constexpr partial_sort_copy_result<I1, I2> |
| 503 | partial_sort_copy(I1 first, S1 last, I2 result_first, S2 result_last, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 504 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Konstantin Varlamov | db7d795 | 2022-07-30 09:42:05 | [diff] [blame] | 505 | |
| 506 | template<input_range R1, random_access_range R2, class Comp = ranges::less, |
| 507 | class Proj1 = identity, class Proj2 = identity> |
| 508 | requires indirectly_copyable<iterator_t<R1>, iterator_t<R2>> && |
| 509 | sortable<iterator_t<R2>, Comp, Proj2> && |
| 510 | indirect_strict_weak_order<Comp, projected<iterator_t<R1>, Proj1>, |
| 511 | projected<iterator_t<R2>, Proj2>> |
| 512 | constexpr partial_sort_copy_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> |
| 513 | partial_sort_copy(R1&& r, R2&& result_r, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 514 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Konstantin Varlamov | db7d795 | 2022-07-30 09:42:05 | [diff] [blame] | 515 | |
Nikolas Klauser | 11e3ad2 | 2022-05-26 14:08:55 | [diff] [blame] | 516 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 517 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
| 518 | constexpr bool ranges::is_sorted(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 519 | |
| 520 | template<forward_range R, class Proj = identity, |
| 521 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 522 | constexpr bool ranges::is_sorted(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 523 | |
| 524 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 525 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> |
| 526 | constexpr I ranges::is_sorted_until(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
| 527 | |
| 528 | template<forward_range R, class Proj = identity, |
| 529 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 530 | constexpr borrowed_iterator_t<R> |
| 531 | ranges::is_sorted_until(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 532 | |
Konstantin Varlamov | 23c7328 | 2022-07-08 03:35:51 | [diff] [blame] | 533 | template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 534 | class Proj = identity> |
| 535 | requires sortable<I, Comp, Proj> |
| 536 | constexpr I |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 537 | ranges::nth_element(I first, I nth, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 23c7328 | 2022-07-08 03:35:51 | [diff] [blame] | 538 | |
| 539 | template<random_access_range R, class Comp = ranges::less, class Proj = identity> |
| 540 | requires sortable<iterator_t<R>, Comp, Proj> |
| 541 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 542 | ranges::nth_element(R&& r, iterator_t<R> nth, Comp comp = {}, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 23c7328 | 2022-07-08 03:35:51 | [diff] [blame] | 543 | |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 544 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 545 | indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> // since C++20 |
| 546 | constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 547 | |
| 548 | template<forward_range R, class T, class Proj = identity, |
| 549 | indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = |
| 550 | ranges::less> |
| 551 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 552 | upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 553 | |
| 554 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 555 | indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> |
| 556 | constexpr I lower_bound(I first, S last, const T& value, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 557 | Proj proj = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 558 | template<forward_range R, class T, class Proj = identity, |
| 559 | indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = |
| 560 | ranges::less> |
| 561 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 562 | lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 563 | |
| 564 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 565 | indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> |
| 566 | constexpr bool binary_search(I first, S last, const T& value, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 567 | Proj proj = {}); // since C++20 |
Nikolas Klauser | b79b2b6 | 2022-06-06 11:57:34 | [diff] [blame] | 568 | |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 569 | template<forward_range R, class T, class Proj = identity, |
| 570 | indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = |
| 571 | ranges::less> |
| 572 | constexpr bool binary_search(R&& r, const T& value, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 573 | Proj proj = {}); // since C++20 |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 574 | |
| 575 | template<permutable I, sentinel_for<I> S, class Proj = identity, |
| 576 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 577 | constexpr subrange<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 578 | partition(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 579 | |
| 580 | template<forward_range R, class Proj = identity, |
| 581 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 582 | requires permutable<iterator_t<R>> |
| 583 | constexpr borrowed_subrange_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 584 | partition(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 585 | |
| 586 | template<bidirectional_iterator I, sentinel_for<I> S, class Proj = identity, |
| 587 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 588 | requires permutable<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 589 | subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 590 | |
| 591 | template<bidirectional_range R, class Proj = identity, |
| 592 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 593 | requires permutable<iterator_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 594 | borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 595 | |
Nikolas Klauser | b79b2b6 | 2022-06-06 11:57:34 | [diff] [blame] | 596 | template<input_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2, |
| 597 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 598 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 599 | constexpr I1 ranges::find_first_of(I1 first1, S1 last1, I2 first2, S2 last2, |
| 600 | Pred pred = {}, |
| 601 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 602 | |
| 603 | template<input_range R1, forward_range R2, |
| 604 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 605 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 606 | constexpr borrowed_iterator_t<R1> |
| 607 | ranges::find_first_of(R1&& r1, R2&& r2, |
| 608 | Pred pred = {}, |
| 609 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 610 | |
Nikolas Klauser | 916e905 | 2022-06-08 10:14:12 | [diff] [blame] | 611 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 612 | indirect_binary_predicate<projected<I, Proj>, |
| 613 | projected<I, Proj>> Pred = ranges::equal_to> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 614 | constexpr I ranges::adjacent_find(I first, S last, Pred pred = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 916e905 | 2022-06-08 10:14:12 | [diff] [blame] | 615 | |
| 616 | template<forward_range R, class Proj = identity, |
| 617 | indirect_binary_predicate<projected<iterator_t<R>, Proj>, |
| 618 | projected<iterator_t<R>, Proj>> Pred = ranges::equal_to> |
| 619 | constexpr borrowed_iterator_t<R> ranges::adjacent_find(R&& r, Pred pred = {}, Proj proj = {}); // since C++20 |
| 620 | |
Nikolas Klauser | ff6d5de | 2022-06-07 07:42:10 | [diff] [blame] | 621 | template<input_iterator I, sentinel_for<I> S, class T1, class T2, class Proj = identity> |
| 622 | requires indirectly_writable<I, const T2&> && |
| 623 | indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*> |
| 624 | constexpr I |
| 625 | ranges::replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = {}); // since C++20 |
| 626 | |
| 627 | template<input_range R, class T1, class T2, class Proj = identity> |
| 628 | requires indirectly_writable<iterator_t<R>, const T2&> && |
| 629 | indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T1*> |
| 630 | constexpr borrowed_iterator_t<R> |
| 631 | ranges::replace(R&& r, const T1& old_value, const T2& new_value, Proj proj = {}); // since C++20 |
| 632 | |
| 633 | template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 634 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 635 | requires indirectly_writable<I, const T&> |
| 636 | constexpr I ranges::replace_if(I first, S last, Pred pred, const T& new_value, Proj proj = {}); // since C++20 |
| 637 | |
| 638 | template<input_range R, class T, class Proj = identity, |
| 639 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 640 | requires indirectly_writable<iterator_t<R>, const T&> |
| 641 | constexpr borrowed_iterator_t<R> |
| 642 | ranges::replace_if(R&& r, Pred pred, const T& new_value, Proj proj = {}); // since C++20 |
| 643 | |
Nikolas Klauser | a203acb | 2022-08-03 23:30:50 | [diff] [blame] | 644 | template<class T, class Proj = identity, |
| 645 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 646 | constexpr const T& |
| 647 | ranges::clamp(const T& v, const T& lo, const T& hi, Comp comp = {}, Proj proj = {}); // since C++20 |
| 648 | |
Nikolas Klauser | afd5a4f | 2022-06-15 14:24:43 | [diff] [blame] | 649 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 650 | class Proj1 = identity, class Proj2 = identity, |
| 651 | indirect_strict_weak_order<projected<I1, Proj1>, |
| 652 | projected<I2, Proj2>> Comp = ranges::less> |
| 653 | constexpr bool |
| 654 | ranges::lexicographical_compare(I1 first1, S1 last1, I2 first2, S2 last2, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 655 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | afd5a4f | 2022-06-15 14:24:43 | [diff] [blame] | 656 | |
| 657 | template<input_range R1, input_range R2, class Proj1 = identity, |
| 658 | class Proj2 = identity, |
| 659 | indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>, |
| 660 | projected<iterator_t<R2>, Proj2>> Comp = ranges::less> |
| 661 | constexpr bool |
| 662 | ranges::lexicographical_compare(R1&& r1, R2&& r2, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 663 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | afd5a4f | 2022-06-15 14:24:43 | [diff] [blame] | 664 | |
Nikolas Klauser | 2c3bbac | 2022-06-23 10:23:41 | [diff] [blame] | 665 | template<bidirectional_iterator I1, sentinel_for<I1> S1, bidirectional_iterator I2> |
| 666 | requires indirectly_movable<I1, I2> |
| 667 | constexpr ranges::move_backward_result<I1, I2> |
| 668 | ranges::move_backward(I1 first, S1 last, I2 result); // since C++20 |
| 669 | |
| 670 | template<bidirectional_range R, bidirectional_iterator I> |
| 671 | requires indirectly_movable<iterator_t<R>, I> |
| 672 | constexpr ranges::move_backward_result<borrowed_iterator_t<R>, I> |
| 673 | ranges::move_backward(R&& r, I result); // since C++20 |
| 674 | |
| 675 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O> |
| 676 | requires indirectly_movable<I, O> |
| 677 | constexpr ranges::move_result<I, O> |
| 678 | ranges::move(I first, S last, O result); // since C++20 |
| 679 | |
| 680 | template<input_range R, weakly_incrementable O> |
| 681 | requires indirectly_movable<iterator_t<R>, O> |
| 682 | constexpr ranges::move_result<borrowed_iterator_t<R>, O> |
| 683 | ranges::move(R&& r, O result); // since C++20 |
| 684 | |
Konstantin Varlamov | 065202f | 2022-07-20 08:57:13 | [diff] [blame] | 685 | template<class I, class O1, class O2> |
| 686 | using partition_copy_result = in_out_out_result<I, O1, O2>; // since C++20 |
| 687 | |
| 688 | template<input_iterator I, sentinel_for<I> S, |
| 689 | weakly_incrementable O1, weakly_incrementable O2, |
| 690 | class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred> |
| 691 | requires indirectly_copyable<I, O1> && indirectly_copyable<I, O2> |
| 692 | constexpr partition_copy_result<I, O1, O2> |
| 693 | partition_copy(I first, S last, O1 out_true, O2 out_false, Pred pred, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 694 | Proj proj = {}); // since C++20 |
Konstantin Varlamov | 065202f | 2022-07-20 08:57:13 | [diff] [blame] | 695 | |
| 696 | template<input_range R, weakly_incrementable O1, weakly_incrementable O2, |
| 697 | class Proj = identity, |
| 698 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 699 | requires indirectly_copyable<iterator_t<R>, O1> && |
| 700 | indirectly_copyable<iterator_t<R>, O2> |
| 701 | constexpr partition_copy_result<borrowed_iterator_t<R>, O1, O2> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 702 | partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 065202f | 2022-07-20 08:57:13 | [diff] [blame] | 703 | |
| 704 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 705 | indirect_unary_predicate<projected<I, Proj>> Pred> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 706 | constexpr I partition_point(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 065202f | 2022-07-20 08:57:13 | [diff] [blame] | 707 | |
| 708 | template<forward_range R, class Proj = identity, |
| 709 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 710 | constexpr borrowed_iterator_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 711 | partition_point(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Konstantin Varlamov | 065202f | 2022-07-20 08:57:13 | [diff] [blame] | 712 | |
Hui Xie | 25607d1 | 2022-06-26 15:13:43 | [diff] [blame] | 713 | template<class I1, class I2, class O> |
| 714 | using merge_result = in_in_out_result<I1, I2, O>; // since C++20 |
| 715 | |
| 716 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 717 | weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, |
| 718 | class Proj2 = identity> |
| 719 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 720 | constexpr merge_result<I1, I2, O> |
| 721 | merge(I1 first1, S1 last1, I2 first2, S2 last2, O result, |
| 722 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 723 | |
| 724 | template<input_range R1, input_range R2, weakly_incrementable O, class Comp = ranges::less, |
| 725 | class Proj1 = identity, class Proj2 = identity> |
| 726 | requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2> |
| 727 | constexpr merge_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> |
| 728 | merge(R1&& r1, R2&& r2, O result, |
| 729 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 2c3bbac | 2022-06-23 10:23:41 | [diff] [blame] | 730 | |
Nikolas Klauser | f8cbe3cdf | 2022-07-06 12:03:00 | [diff] [blame] | 731 | template<permutable I, sentinel_for<I> S, class T, class Proj = identity> |
| 732 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 733 | constexpr subrange<I> ranges::remove(I first, S last, const T& value, Proj proj = {}); // since C++20 |
| 734 | |
| 735 | template<forward_range R, class T, class Proj = identity> |
| 736 | requires permutable<iterator_t<R>> && |
| 737 | indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 738 | constexpr borrowed_subrange_t<R> |
| 739 | ranges::remove(R&& r, const T& value, Proj proj = {}); // since C++20 |
| 740 | |
| 741 | template<permutable I, sentinel_for<I> S, class Proj = identity, |
| 742 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 743 | constexpr subrange<I> ranges::remove_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 744 | |
| 745 | template<forward_range R, class Proj = identity, |
| 746 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 747 | requires permutable<iterator_t<R>> |
| 748 | constexpr borrowed_subrange_t<R> |
| 749 | ranges::remove_if(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 7d426a3 | 2022-07-11 15:07:35 | [diff] [blame] | 750 | |
Hui Xie | 1cdec6c | 2022-06-26 15:13:43 | [diff] [blame] | 751 | template<class I, class O> |
Nikolas Klauser | 7d426a3 | 2022-07-11 15:07:35 | [diff] [blame] | 752 | using set_difference_result = in_out_result<I, O>; // since C++20 |
Hui Xie | 1cdec6c | 2022-06-26 15:13:43 | [diff] [blame] | 753 | |
| 754 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 755 | weakly_incrementable O, class Comp = ranges::less, |
| 756 | class Proj1 = identity, class Proj2 = identity> |
| 757 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 758 | constexpr set_difference_result<I1, O> |
| 759 | set_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, |
| 760 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 761 | |
| 762 | template<input_range R1, input_range R2, weakly_incrementable O, |
| 763 | class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> |
| 764 | requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2> |
| 765 | constexpr set_difference_result<borrowed_iterator_t<R1>, O> |
| 766 | set_difference(R1&& r1, R2&& r2, O result, |
| 767 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | f8cbe3cdf | 2022-07-06 12:03:00 | [diff] [blame] | 768 | |
Hui Xie | 96b674f | 2022-07-08 14:21:40 | [diff] [blame] | 769 | template<class I1, class I2, class O> |
| 770 | using set_intersection_result = in_in_out_result<I1, I2, O>; // since C++20 |
| 771 | |
| 772 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 773 | weakly_incrementable O, class Comp = ranges::less, |
| 774 | class Proj1 = identity, class Proj2 = identity> |
| 775 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 776 | constexpr set_intersection_result<I1, I2, O> |
| 777 | set_intersection(I1 first1, S1 last1, I2 first2, S2 last2, O result, |
| 778 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 779 | |
| 780 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 781 | weakly_incrementable O, class Comp = ranges::less, |
| 782 | class Proj1 = identity, class Proj2 = identity> |
| 783 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 784 | constexpr set_intersection_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> |
| 785 | set_intersection(R1&& r1, R2&& r2, O result, |
| 786 | Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 787 | |
Nikolas Klauser | 7d426a3 | 2022-07-11 15:07:35 | [diff] [blame] | 788 | template <class _InIter, class _OutIter> |
| 789 | using reverse_copy_result = in_out_result<_InIter, _OutIter>; // since C++20 |
| 790 | |
| 791 | template<bidirectional_iterator I, sentinel_for<I> S, weakly_incrementable O> |
| 792 | requires indirectly_copyable<I, O> |
| 793 | constexpr ranges::reverse_copy_result<I, O> |
| 794 | ranges::reverse_copy(I first, S last, O result); // since C++20 |
| 795 | |
| 796 | template<bidirectional_range R, weakly_incrementable O> |
| 797 | requires indirectly_copyable<iterator_t<R>, O> |
| 798 | constexpr ranges::reverse_copy_result<borrowed_iterator_t<R>, O> |
| 799 | ranges::reverse_copy(R&& r, O result); // since C++20 |
| 800 | |
Konstantin Varlamov | 36c746c | 2022-08-03 23:04:14 | [diff] [blame] | 801 | template<permutable I, sentinel_for<I> S> |
| 802 | constexpr subrange<I> rotate(I first, I middle, S last); // since C++20 |
| 803 | |
| 804 | template<forward_range R> |
| 805 | requires permutable<iterator_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 806 | constexpr borrowed_subrange_t<R> rotate(R&& r, iterator_t<R> middle); // since C++20 |
Konstantin Varlamov | 36c746c | 2022-08-03 23:04:14 | [diff] [blame] | 807 | |
Nikolas Klauser | 7d426a3 | 2022-07-11 15:07:35 | [diff] [blame] | 808 | template <class _InIter, class _OutIter> |
| 809 | using rotate_copy_result = in_out_result<_InIter, _OutIter>; // since C++20 |
| 810 | |
| 811 | template<forward_iterator I, sentinel_for<I> S, weakly_incrementable O> |
| 812 | requires indirectly_copyable<I, O> |
| 813 | constexpr ranges::rotate_copy_result<I, O> |
| 814 | ranges::rotate_copy(I first, I middle, S last, O result); // since C++20 |
| 815 | |
| 816 | template<forward_range R, weakly_incrementable O> |
| 817 | requires indirectly_copyable<iterator_t<R>, O> |
| 818 | constexpr ranges::rotate_copy_result<borrowed_iterator_t<R>, O> |
| 819 | ranges::rotate_copy(R&& r, iterator_t<R> middle, O result); // since C++20 |
| 820 | |
Konstantin Varlamov | 6bdb642 | 2022-08-03 05:33:12 | [diff] [blame] | 821 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Gen> |
| 822 | requires (forward_iterator<I> || random_access_iterator<O>) && |
| 823 | indirectly_copyable<I, O> && |
| 824 | uniform_random_bit_generator<remove_reference_t<Gen>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 825 | O sample(I first, S last, O out, iter_difference_t<I> n, Gen&& g); // since C++20 |
Konstantin Varlamov | 6bdb642 | 2022-08-03 05:33:12 | [diff] [blame] | 826 | |
| 827 | template<input_range R, weakly_incrementable O, class Gen> |
| 828 | requires (forward_range<R> || random_access_iterator<O>) && |
| 829 | indirectly_copyable<iterator_t<R>, O> && |
| 830 | uniform_random_bit_generator<remove_reference_t<Gen>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 831 | O sample(R&& r, O out, range_difference_t<R> n, Gen&& g); // since C++20 |
Konstantin Varlamov | 6bdb642 | 2022-08-03 05:33:12 | [diff] [blame] | 832 | |
Konstantin Varlamov | 14cf74d | 2022-07-22 16:58:56 | [diff] [blame] | 833 | template<random_access_iterator I, sentinel_for<I> S, class Gen> |
| 834 | requires permutable<I> && |
| 835 | uniform_random_bit_generator<remove_reference_t<Gen>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 836 | I shuffle(I first, S last, Gen&& g); // since C++20 |
Konstantin Varlamov | 14cf74d | 2022-07-22 16:58:56 | [diff] [blame] | 837 | |
| 838 | template<random_access_range R, class Gen> |
| 839 | requires permutable<iterator_t<R>> && |
| 840 | uniform_random_bit_generator<remove_reference_t<Gen>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 841 | borrowed_iterator_t<R> shuffle(R&& r, Gen&& g); // since C++20 |
Konstantin Varlamov | 14cf74d | 2022-07-22 16:58:56 | [diff] [blame] | 842 | |
Nikolas Klauser | 101d1e9 | 2022-07-13 16:07:26 | [diff] [blame] | 843 | template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, |
Nikolas Klauser | 4038c85 | 2022-08-04 17:54:13 | [diff] [blame] | 844 | sentinel_for<I2> S2, class Proj1 = identity, class Proj2 = identity, |
| 845 | indirect_equivalence_relation<projected<I1, Proj1>, |
| 846 | projected<I2, Proj2>> Pred = ranges::equal_to> |
| 847 | constexpr bool ranges::is_permutation(I1 first1, S1 last1, I2 first2, S2 last2, |
| 848 | Pred pred = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 849 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 4038c85 | 2022-08-04 17:54:13 | [diff] [blame] | 850 | |
| 851 | template<forward_range R1, forward_range R2, |
| 852 | class Proj1 = identity, class Proj2 = identity, |
| 853 | indirect_equivalence_relation<projected<iterator_t<R1>, Proj1>, |
| 854 | projected<iterator_t<R2>, Proj2>> Pred = ranges::equal_to> |
| 855 | constexpr bool ranges::is_permutation(R1&& r1, R2&& r2, Pred pred = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 856 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Nikolas Klauser | 4038c85 | 2022-08-04 17:54:13 | [diff] [blame] | 857 | |
| 858 | template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, |
Nikolas Klauser | 101d1e9 | 2022-07-13 16:07:26 | [diff] [blame] | 859 | sentinel_for<I2> S2, class Pred = ranges::equal_to, |
| 860 | class Proj1 = identity, class Proj2 = identity> |
| 861 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 862 | constexpr subrange<I1> |
| 863 | ranges::search(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, |
| 864 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 865 | |
| 866 | template<forward_range R1, forward_range R2, class Pred = ranges::equal_to, |
| 867 | class Proj1 = identity, class Proj2 = identity> |
| 868 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 869 | constexpr borrowed_subrange_t<R1> |
| 870 | ranges::search(R1&& r1, R2&& r2, Pred pred = {}, |
| 871 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 872 | |
| 873 | template<forward_iterator I, sentinel_for<I> S, class T, |
| 874 | class Pred = ranges::equal_to, class Proj = identity> |
| 875 | requires indirectly_comparable<I, const T*, Pred, Proj> |
| 876 | constexpr subrange<I> |
| 877 | ranges::search_n(I first, S last, iter_difference_t<I> count, |
| 878 | const T& value, Pred pred = {}, Proj proj = {}); // since C++20 |
| 879 | |
| 880 | template<forward_range R, class T, class Pred = ranges::equal_to, |
| 881 | class Proj = identity> |
| 882 | requires indirectly_comparable<iterator_t<R>, const T*, Pred, Proj> |
| 883 | constexpr borrowed_subrange_t<R> |
| 884 | ranges::search_n(R&& r, range_difference_t<R> count, |
| 885 | const T& value, Pred pred = {}, Proj proj = {}); // since C++20 |
| 886 | |
Christopher Di Bella | 3903438 | 2023-12-20 05:57:50 | [diff] [blame^] | 887 | template<input_iterator I, sentinel_for<I> S, class T, |
| 888 | indirectly-binary-left-foldable<T, I> F> |
| 889 | constexpr auto ranges::fold_left(I first, S last, T init, F f); // since C++23 |
| 890 | |
| 891 | template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F> |
| 892 | constexpr auto fold_left(R&& r, T init, F f); // since C++23 |
| 893 | |
| 894 | template<class I, class T> |
| 895 | using fold_left_with_iter_result = in_value_result<I, T>; // since C++23 |
| 896 | |
| 897 | template<input_iterator I, sentinel_for<I> S, class T, |
| 898 | indirectly-binary-left-foldable<T, I> F> |
| 899 | constexpr see below fold_left_with_iter(I first, S last, T init, F f); // since C++23 |
| 900 | |
| 901 | template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F> |
| 902 | constexpr see below fold_left_with_iter(R&& r, T init, F f); // since C++23 |
| 903 | |
Nikolas Klauser | 101d1e9 | 2022-07-13 16:07:26 | [diff] [blame] | 904 | template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2, |
| 905 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 906 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 907 | constexpr subrange<I1> |
| 908 | ranges::find_end(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, |
| 909 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 910 | |
| 911 | template<forward_range R1, forward_range R2, |
| 912 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 913 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 914 | constexpr borrowed_subrange_t<R1> |
| 915 | ranges::find_end(R1&& r1, R2&& r2, Pred pred = {}, |
| 916 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 917 | |
Hui Xie | a5c0638 | 2022-07-11 22:39:59 | [diff] [blame] | 918 | template<class I1, class I2, class O> |
| 919 | using set_symmetric_difference_result = in_in_out_result<I1, I2, O>; // since C++20 |
| 920 | |
| 921 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 922 | weakly_incrementable O, class Comp = ranges::less, |
| 923 | class Proj1 = identity, class Proj2 = identity> |
| 924 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 925 | constexpr set_symmetric_difference_result<I1, I2, O> |
| 926 | set_symmetric_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, |
| 927 | Comp comp = {}, Proj1 proj1 = {}, |
| 928 | Proj2 proj2 = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 929 | |
Hui Xie | a5c0638 | 2022-07-11 22:39:59 | [diff] [blame] | 930 | template<input_range R1, input_range R2, weakly_incrementable O, |
| 931 | class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> |
| 932 | requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2> |
| 933 | constexpr set_symmetric_difference_result<borrowed_iterator_t<R1>, |
| 934 | borrowed_iterator_t<R2>, O> |
| 935 | set_symmetric_difference(R1&& r1, R2&& r2, O result, Comp comp = {}, |
| 936 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Hui Xie | 0f6364b8 | 2022-07-14 19:35:15 | [diff] [blame] | 937 | |
| 938 | template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, |
| 939 | indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> |
| 940 | constexpr subrange<I> |
| 941 | equal_range(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 942 | |
Hui Xie | 0f6364b8 | 2022-07-14 19:35:15 | [diff] [blame] | 943 | template<forward_range R, class T, class Proj = identity, |
| 944 | indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = |
| 945 | ranges::less> |
| 946 | constexpr borrowed_subrange_t<R> |
| 947 | equal_range(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 948 | |
Hui Xie | 3151b95 | 2022-07-13 16:20:22 | [diff] [blame] | 949 | template<class I1, class I2, class O> |
| 950 | using set_union_result = in_in_out_result<I1, I2, O>; // since C++20 |
| 951 | |
| 952 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 953 | weakly_incrementable O, class Comp = ranges::less, |
| 954 | class Proj1 = identity, class Proj2 = identity> |
| 955 | requires mergeable<I1, I2, O, Comp, Proj1, Proj2> |
| 956 | constexpr set_union_result<I1, I2, O> |
| 957 | set_union(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, |
| 958 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
| 959 | |
| 960 | template<input_range R1, input_range R2, weakly_incrementable O, |
| 961 | class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> |
| 962 | requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2> |
| 963 | constexpr set_union_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> |
| 964 | set_union(R1&& r1, R2&& r2, O result, Comp comp = {}, |
| 965 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Hui Xie | c559964 | 2022-07-19 19:54:35 | [diff] [blame] | 966 | |
| 967 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, |
| 968 | class Proj1 = identity, class Proj2 = identity, |
| 969 | indirect_strict_weak_order<projected<I1, Proj1>, projected<I2, Proj2>> Comp = |
| 970 | ranges::less> |
| 971 | constexpr bool includes(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 972 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 973 | |
Hui Xie | c559964 | 2022-07-19 19:54:35 | [diff] [blame] | 974 | template<input_range R1, input_range R2, class Proj1 = identity, |
| 975 | class Proj2 = identity, |
| 976 | indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>, |
| 977 | projected<iterator_t<R2>, Proj2>> Comp = ranges::less> |
| 978 | constexpr bool includes(R1&& r1, R2&& r2, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 979 | Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 980 | |
| 981 | template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 982 | class Proj = identity> |
| 983 | requires sortable<I, Comp, Proj> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 984 | I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 985 | |
| 986 | template<bidirectional_range R, class Comp = ranges::less, class Proj = identity> |
| 987 | requires sortable<iterator_t<R>, Comp, Proj> |
| 988 | borrowed_iterator_t<R> |
| 989 | inplace_merge(R&& r, iterator_t<R> middle, Comp comp = {}, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 990 | Proj proj = {}); // since C++20 |
Hui Xie | 72f57e3 | 2022-07-23 00:44:25 | [diff] [blame] | 991 | |
| 992 | template<permutable I, sentinel_for<I> S, class Proj = identity, |
| 993 | indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 994 | constexpr subrange<I> unique(I first, S last, C comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 72f57e3 | 2022-07-23 00:44:25 | [diff] [blame] | 995 | |
| 996 | template<forward_range R, class Proj = identity, |
| 997 | indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to> |
| 998 | requires permutable<iterator_t<R>> |
| 999 | constexpr borrowed_subrange_t<R> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1000 | unique(R&& r, C comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 72f57e3 | 2022-07-23 00:44:25 | [diff] [blame] | 1001 | |
| 1002 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Proj = identity, |
| 1003 | indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to> |
| 1004 | requires indirectly_copyable<I, O> && |
| 1005 | (forward_iterator<I> || |
| 1006 | (input_iterator<O> && same_as<iter_value_t<I>, iter_value_t<O>>) || |
| 1007 | indirectly_copyable_storable<I, O>) |
| 1008 | constexpr unique_copy_result<I, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1009 | unique_copy(I first, S last, O result, C comp = {}, Proj proj = {}); // since C++20 |
Hui Xie | 72f57e3 | 2022-07-23 00:44:25 | [diff] [blame] | 1010 | |
| 1011 | template<input_range R, weakly_incrementable O, class Proj = identity, |
| 1012 | indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to> |
| 1013 | requires indirectly_copyable<iterator_t<R>, O> && |
| 1014 | (forward_iterator<iterator_t<R>> || |
| 1015 | (input_iterator<O> && same_as<range_value_t<R>, iter_value_t<O>>) || |
| 1016 | indirectly_copyable_storable<iterator_t<R>, O>) |
| 1017 | constexpr unique_copy_result<borrowed_iterator_t<R>, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1018 | unique_copy(R&& r, O result, C comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1019 | |
| 1020 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1021 | using remove_copy_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1022 | |
| 1023 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class T, |
| 1024 | class Proj = identity> |
| 1025 | indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 1026 | constexpr remove_copy_result<I, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1027 | remove_copy(I first, S last, O result, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1028 | |
| 1029 | template<input_range R, weakly_incrementable O, class T, class Proj = identity> |
| 1030 | requires indirectly_copyable<iterator_t<R>, O> && |
| 1031 | indirect_binary_predicate<ranges::equal_to, |
| 1032 | projected<iterator_t<R>, Proj>, const T*> |
| 1033 | constexpr remove_copy_result<borrowed_iterator_t<R>, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1034 | remove_copy(R&& r, O result, const T& value, Proj proj = {}); // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1035 | |
| 1036 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1037 | using remove_copy_if_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1038 | |
| 1039 | template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, |
| 1040 | class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred> |
| 1041 | requires indirectly_copyable<I, O> |
| 1042 | constexpr remove_copy_if_result<I, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1043 | remove_copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1044 | |
| 1045 | template<input_range R, weakly_incrementable O, class Proj = identity, |
| 1046 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 1047 | requires indirectly_copyable<iterator_t<R>, O> |
| 1048 | constexpr remove_copy_if_result<borrowed_iterator_t<R>, O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1049 | remove_copy_if(R&& r, O result, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1050 | |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1051 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1052 | using replace_copy_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1053 | |
| 1054 | template<input_iterator I, sentinel_for<I> S, class T1, class T2, |
| 1055 | output_iterator<const T2&> O, class Proj = identity> |
| 1056 | requires indirectly_copyable<I, O> && |
| 1057 | indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*> |
| 1058 | constexpr replace_copy_result<I, O> |
| 1059 | replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1060 | Proj proj = {}); // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1061 | |
| 1062 | template<input_range R, class T1, class T2, output_iterator<const T2&> O, |
| 1063 | class Proj = identity> |
| 1064 | requires indirectly_copyable<iterator_t<R>, O> && |
| 1065 | indirect_binary_predicate<ranges::equal_to, |
| 1066 | projected<iterator_t<R>, Proj>, const T1*> |
| 1067 | constexpr replace_copy_result<borrowed_iterator_t<R>, O> |
| 1068 | replace_copy(R&& r, O result, const T1& old_value, const T2& new_value, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1069 | Proj proj = {}); // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1070 | |
| 1071 | template<class I, class O> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1072 | using replace_copy_if_result = in_out_result<I, O>; // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1073 | |
| 1074 | template<input_iterator I, sentinel_for<I> S, class T, output_iterator<const T&> O, |
| 1075 | class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred> |
| 1076 | requires indirectly_copyable<I, O> |
| 1077 | constexpr replace_copy_if_result<I, O> |
| 1078 | replace_copy_if(I first, S last, O result, Pred pred, const T& new_value, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1079 | Proj proj = {}); // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1080 | |
| 1081 | template<input_range R, class T, output_iterator<const T&> O, class Proj = identity, |
| 1082 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 1083 | requires indirectly_copyable<iterator_t<R>, O> |
| 1084 | constexpr replace_copy_if_result<borrowed_iterator_t<R>, O> |
| 1085 | replace_copy_if(R&& r, O result, Pred pred, const T& new_value, |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1086 | Proj proj = {}); // since C++20 |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1087 | |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1088 | template<class I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1089 | using prev_permutation_result = in_found_result<I>; // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1090 | |
| 1091 | template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 1092 | class Proj = identity> |
| 1093 | requires sortable<I, Comp, Proj> |
| 1094 | constexpr ranges::prev_permutation_result<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1095 | ranges::prev_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1096 | |
| 1097 | template<bidirectional_range R, class Comp = ranges::less, |
| 1098 | class Proj = identity> |
| 1099 | requires sortable<iterator_t<R>, Comp, Proj> |
| 1100 | constexpr ranges::prev_permutation_result<borrowed_iterator_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1101 | ranges::prev_permutation(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1102 | |
| 1103 | template<class I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1104 | using next_permutation_result = in_found_result<I>; // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1105 | |
| 1106 | template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less, |
| 1107 | class Proj = identity> |
| 1108 | requires sortable<I, Comp, Proj> |
| 1109 | constexpr ranges::next_permutation_result<I> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1110 | ranges::next_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1111 | |
| 1112 | template<bidirectional_range R, class Comp = ranges::less, |
| 1113 | class Proj = identity> |
| 1114 | requires sortable<iterator_t<R>, Comp, Proj> |
| 1115 | constexpr ranges::next_permutation_result<borrowed_iterator_t<R>> |
Mark de Wever | de6827b | 2023-02-24 20:35:41 | [diff] [blame] | 1116 | ranges::next_permutation(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1117 | |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 1118 | } |
| 1119 | |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1120 | template <class InputIterator, class Predicate> |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 1121 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1122 | all_of(InputIterator first, InputIterator last, Predicate pred); |
| 1123 | |
| 1124 | template <class InputIterator, class Predicate> |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 1125 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1126 | any_of(InputIterator first, InputIterator last, Predicate pred); |
| 1127 | |
| 1128 | template <class InputIterator, class Predicate> |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 1129 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1130 | none_of(InputIterator first, InputIterator last, Predicate pred); |
| 1131 | |
| 1132 | template <class InputIterator, class Function> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1133 | constexpr Function // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1134 | for_each(InputIterator first, InputIterator last, Function f); |
| 1135 | |
Marshall Clow | d5c65ff | 2017-05-25 02:29:54 | [diff] [blame] | 1136 | template<class InputIterator, class Size, class Function> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1137 | constexpr InputIterator // constexpr in C++20 |
| 1138 | for_each_n(InputIterator first, Size n, Function f); // C++17 |
Marshall Clow | d5c65ff | 2017-05-25 02:29:54 | [diff] [blame] | 1139 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1140 | template <class InputIterator, class T> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1141 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1142 | find(InputIterator first, InputIterator last, const T& value); |
| 1143 | |
| 1144 | template <class InputIterator, class Predicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1145 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1146 | find_if(InputIterator first, InputIterator last, Predicate pred); |
| 1147 | |
| 1148 | template<class InputIterator, class Predicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1149 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1150 | find_if_not(InputIterator first, InputIterator last, Predicate pred); |
| 1151 | |
| 1152 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1153 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1154 | find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1155 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 1156 | |
| 1157 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1158 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1159 | find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1160 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 1161 | |
| 1162 | template <class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1163 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1164 | find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1165 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 1166 | |
| 1167 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1168 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1169 | find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1170 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 1171 | |
| 1172 | template <class ForwardIterator> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1173 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1174 | adjacent_find(ForwardIterator first, ForwardIterator last); |
| 1175 | |
| 1176 | template <class ForwardIterator, class BinaryPredicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 1177 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1178 | adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); |
| 1179 | |
| 1180 | template <class InputIterator, class T> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 1181 | constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1182 | count(InputIterator first, InputIterator last, const T& value); |
| 1183 | |
| 1184 | template <class InputIterator, class Predicate> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 1185 | constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1186 | count_if(InputIterator first, InputIterator last, Predicate pred); |
| 1187 | |
| 1188 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1189 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1190 | mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); |
| 1191 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1192 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1193 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Aditya Kumar | 331fb80 | 2016-08-25 11:52:38 | [diff] [blame] | 1194 | mismatch(InputIterator1 first1, InputIterator1 last1, |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1195 | InputIterator2 first2, InputIterator2 last2); // **C++14** |
| 1196 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1197 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1198 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1199 | mismatch(InputIterator1 first1, InputIterator1 last1, |
| 1200 | InputIterator2 first2, BinaryPredicate pred); |
| 1201 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1202 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1203 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1204 | mismatch(InputIterator1 first1, InputIterator1 last1, |
| 1205 | InputIterator2 first2, InputIterator2 last2, |
| 1206 | BinaryPredicate pred); // **C++14** |
| 1207 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1208 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1209 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1210 | equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); |
| 1211 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1212 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1213 | constexpr bool // constexpr in C++20 |
Aditya Kumar | 331fb80 | 2016-08-25 11:52:38 | [diff] [blame] | 1214 | equal(InputIterator1 first1, InputIterator1 last1, |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1215 | InputIterator2 first2, InputIterator2 last2); // **C++14** |
| 1216 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1217 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1218 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1219 | equal(InputIterator1 first1, InputIterator1 last1, |
| 1220 | InputIterator2 first2, BinaryPredicate pred); |
| 1221 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1222 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 1223 | constexpr bool // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1224 | equal(InputIterator1 first1, InputIterator1 last1, |
| 1225 | InputIterator2 first2, InputIterator2 last2, |
| 1226 | BinaryPredicate pred); // **C++14** |
| 1227 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1228 | template<class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1229 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1230 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1231 | ForwardIterator2 first2); |
| 1232 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1233 | template<class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1234 | constexpr bool // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1235 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1236 | ForwardIterator2 first2, ForwardIterator2 last2); // **C++14** |
| 1237 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1238 | template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1239 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1240 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1241 | ForwardIterator2 first2, BinaryPredicate pred); |
| 1242 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1243 | template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1244 | constexpr bool // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 1245 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1246 | ForwardIterator2 first2, ForwardIterator2 last2, |
| 1247 | BinaryPredicate pred); // **C++14** |
| 1248 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1249 | template <class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 1250 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1251 | search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1252 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 1253 | |
| 1254 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 1255 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1256 | search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 1257 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 1258 | |
| 1259 | template <class ForwardIterator, class Size, class T> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 1260 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1261 | search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value); |
| 1262 | |
| 1263 | template <class ForwardIterator, class Size, class T, class BinaryPredicate> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 1264 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1265 | search_n(ForwardIterator first, ForwardIterator last, |
| 1266 | Size count, const T& value, BinaryPredicate pred); |
| 1267 | |
| 1268 | template <class InputIterator, class OutputIterator> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 1269 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1270 | copy(InputIterator first, InputIterator last, OutputIterator result); |
| 1271 | |
| 1272 | template<class InputIterator, class OutputIterator, class Predicate> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 1273 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1274 | copy_if(InputIterator first, InputIterator last, |
| 1275 | OutputIterator result, Predicate pred); |
| 1276 | |
| 1277 | template<class InputIterator, class Size, class OutputIterator> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 1278 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1279 | copy_n(InputIterator first, Size n, OutputIterator result); |
| 1280 | |
| 1281 | template <class BidirectionalIterator1, class BidirectionalIterator2> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 1282 | constexpr BidirectionalIterator2 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1283 | copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, |
| 1284 | BidirectionalIterator2 result); |
| 1285 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 1286 | // [alg.move], move |
| 1287 | template<class InputIterator, class OutputIterator> |
| 1288 | constexpr OutputIterator move(InputIterator first, InputIterator last, |
| 1289 | OutputIterator result); |
| 1290 | |
| 1291 | template<class BidirectionalIterator1, class BidirectionalIterator2> |
| 1292 | constexpr BidirectionalIterator2 |
| 1293 | move_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, |
| 1294 | BidirectionalIterator2 result); |
| 1295 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1296 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1297 | constexpr ForwardIterator2 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1298 | swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); |
| 1299 | |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 1300 | namespace ranges { |
| 1301 | template<class I1, class I2> |
| 1302 | using swap_ranges_result = in_in_result<I1, I2>; |
| 1303 | |
Nikolas Klauser | 9d90531 | 2022-02-10 12:33:03 | [diff] [blame] | 1304 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2> |
| 1305 | requires indirectly_swappable<I1, I2> |
| 1306 | constexpr ranges::swap_ranges_result<I1, I2> |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 1307 | swap_ranges(I1 first1, S1 last1, I2 first2, S2 last2); |
Nikolas Klauser | 9d90531 | 2022-02-10 12:33:03 | [diff] [blame] | 1308 | |
| 1309 | template<input_range R1, input_range R2> |
| 1310 | requires indirectly_swappable<iterator_t<R1>, iterator_t<R2>> |
| 1311 | constexpr ranges::swap_ranges_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> |
Konstantin Varlamov | 79a2b4b | 2022-06-28 18:59:59 | [diff] [blame] | 1312 | swap_ranges(R1&& r1, R2&& r2); |
| 1313 | } |
Nikolas Klauser | 9d90531 | 2022-02-10 12:33:03 | [diff] [blame] | 1314 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1315 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1316 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1317 | iter_swap(ForwardIterator1 a, ForwardIterator2 b); |
| 1318 | |
| 1319 | template <class InputIterator, class OutputIterator, class UnaryOperation> |
Marshall Clow | 99894b6 | 2018-01-19 17:45:39 | [diff] [blame] | 1320 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1321 | transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op); |
| 1322 | |
| 1323 | template <class InputIterator1, class InputIterator2, class OutputIterator, class BinaryOperation> |
Marshall Clow | 99894b6 | 2018-01-19 17:45:39 | [diff] [blame] | 1324 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1325 | transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, |
| 1326 | OutputIterator result, BinaryOperation binary_op); |
| 1327 | |
| 1328 | template <class ForwardIterator, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 1329 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1330 | replace(ForwardIterator first, ForwardIterator last, const T& old_value, const T& new_value); |
| 1331 | |
| 1332 | template <class ForwardIterator, class Predicate, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 1333 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1334 | replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value); |
| 1335 | |
| 1336 | template <class InputIterator, class OutputIterator, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 1337 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1338 | replace_copy(InputIterator first, InputIterator last, OutputIterator result, |
| 1339 | const T& old_value, const T& new_value); |
| 1340 | |
| 1341 | template <class InputIterator, class OutputIterator, class Predicate, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 1342 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1343 | replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, const T& new_value); |
| 1344 | |
| 1345 | template <class ForwardIterator, class T> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 1346 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1347 | fill(ForwardIterator first, ForwardIterator last, const T& value); |
| 1348 | |
| 1349 | template <class OutputIterator, class Size, class T> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 1350 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1351 | fill_n(OutputIterator first, Size n, const T& value); |
| 1352 | |
| 1353 | template <class ForwardIterator, class Generator> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 1354 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1355 | generate(ForwardIterator first, ForwardIterator last, Generator gen); |
| 1356 | |
| 1357 | template <class OutputIterator, class Size, class Generator> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 1358 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1359 | generate_n(OutputIterator first, Size n, Generator gen); |
| 1360 | |
| 1361 | template <class ForwardIterator, class T> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 1362 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1363 | remove(ForwardIterator first, ForwardIterator last, const T& value); |
| 1364 | |
| 1365 | template <class ForwardIterator, class Predicate> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 1366 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1367 | remove_if(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 1368 | |
| 1369 | template <class InputIterator, class OutputIterator, class T> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 1370 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1371 | remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value); |
| 1372 | |
| 1373 | template <class InputIterator, class OutputIterator, class Predicate> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 1374 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1375 | remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred); |
| 1376 | |
| 1377 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1378 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1379 | unique(ForwardIterator first, ForwardIterator last); |
| 1380 | |
| 1381 | template <class ForwardIterator, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1382 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1383 | unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); |
| 1384 | |
| 1385 | template <class InputIterator, class OutputIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1386 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1387 | unique_copy(InputIterator first, InputIterator last, OutputIterator result); |
| 1388 | |
| 1389 | template <class InputIterator, class OutputIterator, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1390 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1391 | unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred); |
| 1392 | |
| 1393 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1394 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1395 | reverse(BidirectionalIterator first, BidirectionalIterator last); |
| 1396 | |
| 1397 | template <class BidirectionalIterator, class OutputIterator> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 1398 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1399 | reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result); |
| 1400 | |
| 1401 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1402 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1403 | rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last); |
| 1404 | |
| 1405 | template <class ForwardIterator, class OutputIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1406 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1407 | rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result); |
| 1408 | |
| 1409 | template <class RandomAccessIterator> |
| 1410 | void |
Marshall Clow | 0f37a41 | 2017-03-23 13:43:37 | [diff] [blame] | 1411 | random_shuffle(RandomAccessIterator first, RandomAccessIterator last); // deprecated in C++14, removed in C++17 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1412 | |
| 1413 | template <class RandomAccessIterator, class RandomNumberGenerator> |
| 1414 | void |
Marshall Clow | 06965c1 | 2014-03-03 06:14:19 | [diff] [blame] | 1415 | random_shuffle(RandomAccessIterator first, RandomAccessIterator last, |
Marshall Clow | 0f37a41 | 2017-03-23 13:43:37 | [diff] [blame] | 1416 | RandomNumberGenerator& rand); // deprecated in C++14, removed in C++17 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1417 | |
Eric Fiselier | e715470 | 2016-08-28 22:14:37 | [diff] [blame] | 1418 | template<class PopulationIterator, class SampleIterator, |
| 1419 | class Distance, class UniformRandomBitGenerator> |
| 1420 | SampleIterator sample(PopulationIterator first, PopulationIterator last, |
| 1421 | SampleIterator out, Distance n, |
| 1422 | UniformRandomBitGenerator&& g); // C++17 |
| 1423 | |
Howard Hinnant | f9d540b | 2010-05-26 17:49:34 | [diff] [blame] | 1424 | template<class RandomAccessIterator, class UniformRandomNumberGenerator> |
| 1425 | void shuffle(RandomAccessIterator first, RandomAccessIterator last, |
Howard Hinnant | fb34010 | 2010-11-18 01:47:02 | [diff] [blame] | 1426 | UniformRandomNumberGenerator&& g); |
Howard Hinnant | f9d540b | 2010-05-26 17:49:34 | [diff] [blame] | 1427 | |
Arthur O'Dwyer | 3fbd3ea | 2020-12-26 06:39:03 | [diff] [blame] | 1428 | template<class ForwardIterator> |
| 1429 | constexpr ForwardIterator |
| 1430 | shift_left(ForwardIterator first, ForwardIterator last, |
| 1431 | typename iterator_traits<ForwardIterator>::difference_type n); // C++20 |
| 1432 | |
| 1433 | template<class ForwardIterator> |
| 1434 | constexpr ForwardIterator |
| 1435 | shift_right(ForwardIterator first, ForwardIterator last, |
| 1436 | typename iterator_traits<ForwardIterator>::difference_type n); // C++20 |
| 1437 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1438 | template <class InputIterator, class Predicate> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1439 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1440 | is_partitioned(InputIterator first, InputIterator last, Predicate pred); |
| 1441 | |
| 1442 | template <class ForwardIterator, class Predicate> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1443 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1444 | partition(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 1445 | |
| 1446 | template <class InputIterator, class OutputIterator1, |
| 1447 | class OutputIterator2, class Predicate> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1448 | constexpr pair<OutputIterator1, OutputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1449 | partition_copy(InputIterator first, InputIterator last, |
| 1450 | OutputIterator1 out_true, OutputIterator2 out_false, |
| 1451 | Predicate pred); |
| 1452 | |
| 1453 | template <class ForwardIterator, class Predicate> |
| 1454 | ForwardIterator |
| 1455 | stable_partition(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 1456 | |
| 1457 | template<class ForwardIterator, class Predicate> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1458 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1459 | partition_point(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 1460 | |
| 1461 | template <class ForwardIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1462 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1463 | is_sorted(ForwardIterator first, ForwardIterator last); |
| 1464 | |
| 1465 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1466 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1467 | is_sorted(ForwardIterator first, ForwardIterator last, Compare comp); |
| 1468 | |
| 1469 | template<class ForwardIterator> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 1470 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1471 | is_sorted_until(ForwardIterator first, ForwardIterator last); |
| 1472 | |
| 1473 | template <class ForwardIterator, class Compare> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 1474 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1475 | is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp); |
| 1476 | |
| 1477 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 493f140 | 2020-12-20 20:21:42 | [diff] [blame] | 1478 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1479 | sort(RandomAccessIterator first, RandomAccessIterator last); |
| 1480 | |
| 1481 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 493f140 | 2020-12-20 20:21:42 | [diff] [blame] | 1482 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1483 | sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1484 | |
| 1485 | template <class RandomAccessIterator> |
| 1486 | void |
| 1487 | stable_sort(RandomAccessIterator first, RandomAccessIterator last); |
| 1488 | |
| 1489 | template <class RandomAccessIterator, class Compare> |
| 1490 | void |
| 1491 | stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1492 | |
| 1493 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1494 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1495 | partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last); |
| 1496 | |
| 1497 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1498 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1499 | partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp); |
| 1500 | |
| 1501 | template <class InputIterator, class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1502 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1503 | partial_sort_copy(InputIterator first, InputIterator last, |
| 1504 | RandomAccessIterator result_first, RandomAccessIterator result_last); |
| 1505 | |
| 1506 | template <class InputIterator, class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1507 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1508 | partial_sort_copy(InputIterator first, InputIterator last, |
| 1509 | RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp); |
| 1510 | |
| 1511 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5d95656 | 2021-02-04 23:12:52 | [diff] [blame] | 1512 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1513 | nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last); |
| 1514 | |
| 1515 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5d95656 | 2021-02-04 23:12:52 | [diff] [blame] | 1516 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1517 | nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp); |
| 1518 | |
| 1519 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1520 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1521 | lower_bound(ForwardIterator first, ForwardIterator last, const T& value); |
| 1522 | |
| 1523 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1524 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1525 | lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 1526 | |
| 1527 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1528 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1529 | upper_bound(ForwardIterator first, ForwardIterator last, const T& value); |
| 1530 | |
| 1531 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1532 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1533 | upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 1534 | |
| 1535 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1536 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1537 | equal_range(ForwardIterator first, ForwardIterator last, const T& value); |
| 1538 | |
| 1539 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1540 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1541 | equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 1542 | |
| 1543 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 1544 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1545 | binary_search(ForwardIterator first, ForwardIterator last, const T& value); |
| 1546 | |
| 1547 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 1548 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1549 | binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 1550 | |
| 1551 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1552 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1553 | merge(InputIterator1 first1, InputIterator1 last1, |
| 1554 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 1555 | |
| 1556 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1557 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1558 | merge(InputIterator1 first1, InputIterator1 last1, |
| 1559 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 1560 | |
| 1561 | template <class BidirectionalIterator> |
| 1562 | void |
| 1563 | inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last); |
| 1564 | |
| 1565 | template <class BidirectionalIterator, class Compare> |
| 1566 | void |
| 1567 | inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp); |
| 1568 | |
| 1569 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 1570 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1571 | includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); |
| 1572 | |
| 1573 | template <class InputIterator1, class InputIterator2, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 1574 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1575 | includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); |
| 1576 | |
| 1577 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1578 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1579 | set_union(InputIterator1 first1, InputIterator1 last1, |
| 1580 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 1581 | |
| 1582 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1583 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1584 | set_union(InputIterator1 first1, InputIterator1 last1, |
| 1585 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 1586 | |
| 1587 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 1588 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1589 | set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 1590 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 1591 | |
| 1592 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 1593 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1594 | set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 1595 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 1596 | |
| 1597 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1598 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1599 | set_difference(InputIterator1 first1, InputIterator1 last1, |
| 1600 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 1601 | |
| 1602 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1603 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1604 | set_difference(InputIterator1 first1, InputIterator1 last1, |
| 1605 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 1606 | |
| 1607 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1608 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1609 | set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 1610 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 1611 | |
| 1612 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 1613 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1614 | set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 1615 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 1616 | |
| 1617 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1618 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1619 | push_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 1620 | |
| 1621 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1622 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1623 | push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1624 | |
| 1625 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1626 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1627 | pop_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 1628 | |
| 1629 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1630 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1631 | pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1632 | |
| 1633 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1634 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1635 | make_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 1636 | |
| 1637 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1638 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1639 | make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1640 | |
| 1641 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1642 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1643 | sort_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 1644 | |
| 1645 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 1646 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1647 | sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 1648 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1649 | template <class RandomAccessIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1650 | constexpr bool // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1651 | is_heap(RandomAccessIterator first, RandomAccessiterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1652 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1653 | template <class RandomAccessIterator, class Compare> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1654 | constexpr bool // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1655 | is_heap(RandomAccessIterator first, RandomAccessiterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1656 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1657 | template <class RandomAccessIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1658 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1659 | is_heap_until(RandomAccessIterator first, RandomAccessiterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1660 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1661 | template <class RandomAccessIterator, class Compare> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 1662 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 1663 | is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1664 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1665 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1666 | constexpr ForwardIterator // constexpr in C++14 |
| 1667 | min_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1668 | |
| 1669 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1670 | constexpr ForwardIterator // constexpr in C++14 |
| 1671 | min_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1672 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1673 | template <class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1674 | constexpr const T& // constexpr in C++14 |
| 1675 | min(const T& a, const T& b); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1676 | |
| 1677 | template <class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1678 | constexpr const T& // constexpr in C++14 |
| 1679 | min(const T& a, const T& b, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1680 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1681 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1682 | constexpr T // constexpr in C++14 |
| 1683 | min(initializer_list<T> t); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1684 | |
| 1685 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1686 | constexpr T // constexpr in C++14 |
| 1687 | min(initializer_list<T> t, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1688 | |
Marshall Clow | 146c14a | 2016-03-07 22:43:49 | [diff] [blame] | 1689 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1690 | constexpr const T& clamp(const T& v, const T& lo, const T& hi); // C++17 |
Marshall Clow | 146c14a | 2016-03-07 22:43:49 | [diff] [blame] | 1691 | |
| 1692 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1693 | constexpr const T& clamp(const T& v, const T& lo, const T& hi, Compare comp); // C++17 |
Marshall Clow | 146c14a | 2016-03-07 22:43:49 | [diff] [blame] | 1694 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1695 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1696 | constexpr ForwardIterator // constexpr in C++14 |
| 1697 | max_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1698 | |
| 1699 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1700 | constexpr ForwardIterator // constexpr in C++14 |
| 1701 | max_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1702 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1703 | template <class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1704 | constexpr const T& // constexpr in C++14 |
| 1705 | max(const T& a, const T& b); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1706 | |
| 1707 | template <class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1708 | constexpr const T& // constexpr in C++14 |
| 1709 | max(const T& a, const T& b, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1710 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1711 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1712 | constexpr T // constexpr in C++14 |
| 1713 | max(initializer_list<T> t); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1714 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1715 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1716 | constexpr T // constexpr in C++14 |
| 1717 | max(initializer_list<T> t, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1718 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1719 | template<class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1720 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 |
| 1721 | minmax_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1722 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1723 | template<class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1724 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 |
| 1725 | minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1726 | |
| 1727 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1728 | constexpr pair<const T&, const T&> // constexpr in C++14 |
| 1729 | minmax(const T& a, const T& b); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1730 | |
| 1731 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1732 | constexpr pair<const T&, const T&> // constexpr in C++14 |
| 1733 | minmax(const T& a, const T& b, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1734 | |
| 1735 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1736 | constexpr pair<T, T> // constexpr in C++14 |
| 1737 | minmax(initializer_list<T> t); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 1738 | |
| 1739 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 1740 | constexpr pair<T, T> // constexpr in C++14 |
| 1741 | minmax(initializer_list<T> t, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1742 | |
| 1743 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1744 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1745 | lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); |
| 1746 | |
| 1747 | template <class InputIterator1, class InputIterator2, class Compare> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 1748 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1749 | lexicographical_compare(InputIterator1 first1, InputIterator1 last1, |
| 1750 | InputIterator2 first2, InputIterator2 last2, Compare comp); |
| 1751 | |
Adrian Vogelsgesang | 2a06757 | 2022-08-04 22:21:27 | [diff] [blame] | 1752 | template<class InputIterator1, class InputIterator2, class Cmp> |
| 1753 | constexpr auto |
| 1754 | lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1, |
| 1755 | InputIterator2 first2, InputIterator2 last2, |
| 1756 | Cmp comp) |
| 1757 | -> decltype(comp(*b1, *b2)); // since C++20 |
| 1758 | |
| 1759 | template<class InputIterator1, class InputIterator2> |
| 1760 | constexpr auto |
| 1761 | lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1, |
| 1762 | InputIterator2 first2, InputIterator2 last2); // since C++20 |
| 1763 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1764 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1765 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1766 | next_permutation(BidirectionalIterator first, BidirectionalIterator last); |
| 1767 | |
| 1768 | template <class BidirectionalIterator, class Compare> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1769 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1770 | next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); |
| 1771 | |
| 1772 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1773 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1774 | prev_permutation(BidirectionalIterator first, BidirectionalIterator last); |
| 1775 | |
| 1776 | template <class BidirectionalIterator, class Compare> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 1777 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1778 | prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1779 | } // std |
| 1780 | |
| 1781 | */ |
| 1782 | |
Louis Dionne | 385cc25 | 2022-03-25 16:55:36 | [diff] [blame] | 1783 | #include <__assert> // all public C++ headers provide the assertion handler |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1784 | #include <__config> |
Marshall Clow | f56972e | 2018-09-12 19:41:40 | [diff] [blame] | 1785 | #include <version> |
Howard Hinnant | 5d1a701 | 2013-08-14 18:00:20 | [diff] [blame] | 1786 | |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1787 | #include <__algorithm/adjacent_find.h> |
| 1788 | #include <__algorithm/all_of.h> |
| 1789 | #include <__algorithm/any_of.h> |
| 1790 | #include <__algorithm/binary_search.h> |
| 1791 | #include <__algorithm/clamp.h> |
| 1792 | #include <__algorithm/comp.h> |
| 1793 | #include <__algorithm/comp_ref_type.h> |
| 1794 | #include <__algorithm/copy.h> |
| 1795 | #include <__algorithm/copy_backward.h> |
| 1796 | #include <__algorithm/copy_if.h> |
| 1797 | #include <__algorithm/copy_n.h> |
| 1798 | #include <__algorithm/count.h> |
| 1799 | #include <__algorithm/count_if.h> |
| 1800 | #include <__algorithm/equal.h> |
| 1801 | #include <__algorithm/equal_range.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1802 | #include <__algorithm/fill.h> |
Arthur O'Dwyer | 4d81a46 | 2022-01-07 14:45:05 | [diff] [blame] | 1803 | #include <__algorithm/fill_n.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1804 | #include <__algorithm/find.h> |
| 1805 | #include <__algorithm/find_end.h> |
| 1806 | #include <__algorithm/find_first_of.h> |
| 1807 | #include <__algorithm/find_if.h> |
| 1808 | #include <__algorithm/find_if_not.h> |
Christopher Di Bella | 3903438 | 2023-12-20 05:57:50 | [diff] [blame^] | 1809 | #include <__algorithm/fold.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1810 | #include <__algorithm/for_each.h> |
| 1811 | #include <__algorithm/for_each_n.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1812 | #include <__algorithm/generate.h> |
Arthur O'Dwyer | 4d81a46 | 2022-01-07 14:45:05 | [diff] [blame] | 1813 | #include <__algorithm/generate_n.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1814 | #include <__algorithm/half_positive.h> |
Nikolas Klauser | 68f4131 | 2022-02-21 22:07:02 | [diff] [blame] | 1815 | #include <__algorithm/in_found_result.h> |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 1816 | #include <__algorithm/in_fun_result.h> |
Nikolas Klauser | f3514af | 2022-01-25 10:21:47 | [diff] [blame] | 1817 | #include <__algorithm/in_in_out_result.h> |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 1818 | #include <__algorithm/in_in_result.h> |
Nikolas Klauser | 610979b | 2022-02-03 01:17:03 | [diff] [blame] | 1819 | #include <__algorithm/in_out_out_result.h> |
Konstantin Varlamov | 8d23b74 | 2022-01-11 06:49:37 | [diff] [blame] | 1820 | #include <__algorithm/in_out_result.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1821 | #include <__algorithm/includes.h> |
| 1822 | #include <__algorithm/inplace_merge.h> |
| 1823 | #include <__algorithm/is_heap.h> |
| 1824 | #include <__algorithm/is_heap_until.h> |
| 1825 | #include <__algorithm/is_partitioned.h> |
| 1826 | #include <__algorithm/is_permutation.h> |
| 1827 | #include <__algorithm/is_sorted.h> |
| 1828 | #include <__algorithm/is_sorted_until.h> |
Christopher Di Bella | 6adbc83 | 2021-06-05 02:47:47 | [diff] [blame] | 1829 | #include <__algorithm/iter_swap.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1830 | #include <__algorithm/lexicographical_compare.h> |
Adrian Vogelsgesang | 2a06757 | 2022-08-04 22:21:27 | [diff] [blame] | 1831 | #include <__algorithm/lexicographical_compare_three_way.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1832 | #include <__algorithm/lower_bound.h> |
| 1833 | #include <__algorithm/make_heap.h> |
| 1834 | #include <__algorithm/max.h> |
| 1835 | #include <__algorithm/max_element.h> |
| 1836 | #include <__algorithm/merge.h> |
| 1837 | #include <__algorithm/min.h> |
| 1838 | #include <__algorithm/min_element.h> |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 1839 | #include <__algorithm/min_max_result.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1840 | #include <__algorithm/minmax.h> |
| 1841 | #include <__algorithm/minmax_element.h> |
| 1842 | #include <__algorithm/mismatch.h> |
| 1843 | #include <__algorithm/move.h> |
| 1844 | #include <__algorithm/move_backward.h> |
| 1845 | #include <__algorithm/next_permutation.h> |
| 1846 | #include <__algorithm/none_of.h> |
| 1847 | #include <__algorithm/nth_element.h> |
| 1848 | #include <__algorithm/partial_sort.h> |
| 1849 | #include <__algorithm/partial_sort_copy.h> |
| 1850 | #include <__algorithm/partition.h> |
| 1851 | #include <__algorithm/partition_copy.h> |
| 1852 | #include <__algorithm/partition_point.h> |
| 1853 | #include <__algorithm/pop_heap.h> |
| 1854 | #include <__algorithm/prev_permutation.h> |
Nikolas Klauser | e7e3711 | 2023-05-05 15:41:13 | [diff] [blame] | 1855 | #include <__algorithm/pstl_any_all_none_of.h> |
Nikolas Klauser | 7ace54e | 2023-05-15 17:38:01 | [diff] [blame] | 1856 | #include <__algorithm/pstl_copy.h> |
Nikolas Klauser | 7a3b528 | 2023-06-06 15:42:40 | [diff] [blame] | 1857 | #include <__algorithm/pstl_count.h> |
Nikolas Klauser | ed27a4e | 2023-11-28 21:02:18 | [diff] [blame] | 1858 | #include <__algorithm/pstl_equal.h> |
Nikolas Klauser | e7e3711 | 2023-05-05 15:41:13 | [diff] [blame] | 1859 | #include <__algorithm/pstl_fill.h> |
| 1860 | #include <__algorithm/pstl_find.h> |
| 1861 | #include <__algorithm/pstl_for_each.h> |
Nikolas Klauser | cd91610 | 2023-06-09 20:45:34 | [diff] [blame] | 1862 | #include <__algorithm/pstl_generate.h> |
Nikolas Klauser | 3a7876f | 2023-06-13 17:50:38 | [diff] [blame] | 1863 | #include <__algorithm/pstl_is_partitioned.h> |
Nikolas Klauser | bf63b15 | 2023-05-30 16:27:10 | [diff] [blame] | 1864 | #include <__algorithm/pstl_merge.h> |
Nikolas Klauser | d2a46e6 | 2023-10-22 08:23:22 | [diff] [blame] | 1865 | #include <__algorithm/pstl_move.h> |
Nikolas Klauser | 51131ed | 2023-06-06 15:43:22 | [diff] [blame] | 1866 | #include <__algorithm/pstl_replace.h> |
Nikolas Klauser | 5d7f346 | 2023-10-23 10:35:12 | [diff] [blame] | 1867 | #include <__algorithm/pstl_rotate_copy.h> |
Nikolas Klauser | 37e5baf | 2023-07-20 21:45:19 | [diff] [blame] | 1868 | #include <__algorithm/pstl_sort.h> |
Nikolas Klauser | d51a84b | 2023-06-01 22:05:11 | [diff] [blame] | 1869 | #include <__algorithm/pstl_stable_sort.h> |
Nikolas Klauser | 6851d07 | 2023-05-15 14:07:45 | [diff] [blame] | 1870 | #include <__algorithm/pstl_transform.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1871 | #include <__algorithm/push_heap.h> |
Nikolas Klauser | 916e905 | 2022-06-08 10:14:12 | [diff] [blame] | 1872 | #include <__algorithm/ranges_adjacent_find.h> |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 1873 | #include <__algorithm/ranges_all_of.h> |
| 1874 | #include <__algorithm/ranges_any_of.h> |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 1875 | #include <__algorithm/ranges_binary_search.h> |
Nikolas Klauser | a203acb | 2022-08-03 23:30:50 | [diff] [blame] | 1876 | #include <__algorithm/ranges_clamp.h> |
ZijunZhaoCCK | fdd089b | 2023-12-20 00:34:19 | [diff] [blame] | 1877 | #include <__algorithm/ranges_contains.h> |
Nikolas Klauser | 1d83750 | 2022-04-15 11:43:40 | [diff] [blame] | 1878 | #include <__algorithm/ranges_copy.h> |
| 1879 | #include <__algorithm/ranges_copy_backward.h> |
| 1880 | #include <__algorithm/ranges_copy_if.h> |
| 1881 | #include <__algorithm/ranges_copy_n.h> |
Nikolas Klauser | 1306b10 | 2022-04-07 11:02:02 | [diff] [blame] | 1882 | #include <__algorithm/ranges_count.h> |
| 1883 | #include <__algorithm/ranges_count_if.h> |
Zijun Zhao | 0218ea4 | 2023-09-18 18:28:11 | [diff] [blame] | 1884 | #include <__algorithm/ranges_ends_with.h> |
Nikolas Klauser | 569d663 | 2022-05-25 09:09:43 | [diff] [blame] | 1885 | #include <__algorithm/ranges_equal.h> |
Hui Xie | 0f6364b8 | 2022-07-14 19:35:15 | [diff] [blame] | 1886 | #include <__algorithm/ranges_equal_range.h> |
Nikolas Klauser | 7af89a3 | 2022-05-21 16:26:29 | [diff] [blame] | 1887 | #include <__algorithm/ranges_fill.h> |
| 1888 | #include <__algorithm/ranges_fill_n.h> |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 1889 | #include <__algorithm/ranges_find.h> |
Nikolas Klauser | 101d1e9 | 2022-07-13 16:07:26 | [diff] [blame] | 1890 | #include <__algorithm/ranges_find_end.h> |
Nikolas Klauser | b79b2b6 | 2022-06-06 11:57:34 | [diff] [blame] | 1891 | #include <__algorithm/ranges_find_first_of.h> |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 1892 | #include <__algorithm/ranges_find_if.h> |
| 1893 | #include <__algorithm/ranges_find_if_not.h> |
Nikolas Klauser | 80045e9 | 2022-05-04 18:27:07 | [diff] [blame] | 1894 | #include <__algorithm/ranges_for_each.h> |
| 1895 | #include <__algorithm/ranges_for_each_n.h> |
Konstantin Varlamov | ead7302 | 2022-07-26 22:50:14 | [diff] [blame] | 1896 | #include <__algorithm/ranges_generate.h> |
| 1897 | #include <__algorithm/ranges_generate_n.h> |
Hui Xie | c559964 | 2022-07-19 19:54:35 | [diff] [blame] | 1898 | #include <__algorithm/ranges_includes.h> |
Hui Xie | 8a61749 | 2022-07-27 12:20:16 | [diff] [blame] | 1899 | #include <__algorithm/ranges_inplace_merge.h> |
Konstantin Varlamov | d406c64 | 2022-07-26 23:11:09 | [diff] [blame] | 1900 | #include <__algorithm/ranges_is_heap.h> |
| 1901 | #include <__algorithm/ranges_is_heap_until.h> |
Nikolas Klauser | 37ba1b9 | 2022-05-04 12:19:09 | [diff] [blame] | 1902 | #include <__algorithm/ranges_is_partitioned.h> |
Nikolas Klauser | 4038c85 | 2022-08-04 17:54:13 | [diff] [blame] | 1903 | #include <__algorithm/ranges_is_permutation.h> |
Nikolas Klauser | 11e3ad2 | 2022-05-26 14:08:55 | [diff] [blame] | 1904 | #include <__algorithm/ranges_is_sorted.h> |
| 1905 | #include <__algorithm/ranges_is_sorted_until.h> |
Nikolas Klauser | afd5a4f | 2022-06-15 14:24:43 | [diff] [blame] | 1906 | #include <__algorithm/ranges_lexicographical_compare.h> |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 1907 | #include <__algorithm/ranges_lower_bound.h> |
Konstantin Varlamov | c945bd0 | 2022-07-08 20:46:27 | [diff] [blame] | 1908 | #include <__algorithm/ranges_make_heap.h> |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame] | 1909 | #include <__algorithm/ranges_max.h> |
Nikolas Klauser | 205557c | 2022-03-07 16:01:52 | [diff] [blame] | 1910 | #include <__algorithm/ranges_max_element.h> |
Hui Xie | 25607d1 | 2022-06-26 15:13:43 | [diff] [blame] | 1911 | #include <__algorithm/ranges_merge.h> |
Nikolas Klauser | f83d833 | 2022-03-18 01:57:08 | [diff] [blame] | 1912 | #include <__algorithm/ranges_min.h> |
Nikolas Klauser | 3b470d1 | 2022-02-11 12:11:57 | [diff] [blame] | 1913 | #include <__algorithm/ranges_min_element.h> |
Nikolas Klauser | 58d9ab7 | 2022-04-13 20:59:09 | [diff] [blame] | 1914 | #include <__algorithm/ranges_minmax.h> |
| 1915 | #include <__algorithm/ranges_minmax_element.h> |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 1916 | #include <__algorithm/ranges_mismatch.h> |
Nikolas Klauser | 2c3bbac | 2022-06-23 10:23:41 | [diff] [blame] | 1917 | #include <__algorithm/ranges_move.h> |
| 1918 | #include <__algorithm/ranges_move_backward.h> |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1919 | #include <__algorithm/ranges_next_permutation.h> |
Nikolas Klauser | 0e3dc1a | 2022-05-26 14:42:46 | [diff] [blame] | 1920 | #include <__algorithm/ranges_none_of.h> |
Konstantin Varlamov | 23c7328 | 2022-07-08 03:35:51 | [diff] [blame] | 1921 | #include <__algorithm/ranges_nth_element.h> |
varconst | 5dd19ad | 2022-07-20 03:10:02 | [diff] [blame] | 1922 | #include <__algorithm/ranges_partial_sort.h> |
Konstantin Varlamov | db7d795 | 2022-07-30 09:42:05 | [diff] [blame] | 1923 | #include <__algorithm/ranges_partial_sort_copy.h> |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 1924 | #include <__algorithm/ranges_partition.h> |
Konstantin Varlamov | 065202f | 2022-07-20 08:57:13 | [diff] [blame] | 1925 | #include <__algorithm/ranges_partition_copy.h> |
| 1926 | #include <__algorithm/ranges_partition_point.h> |
Konstantin Varlamov | c945bd0 | 2022-07-08 20:46:27 | [diff] [blame] | 1927 | #include <__algorithm/ranges_pop_heap.h> |
Nikolas Klauser | 68264b6 | 2022-08-03 05:40:13 | [diff] [blame] | 1928 | #include <__algorithm/ranges_prev_permutation.h> |
Konstantin Varlamov | c945bd0 | 2022-07-08 20:46:27 | [diff] [blame] | 1929 | #include <__algorithm/ranges_push_heap.h> |
Nikolas Klauser | f8cbe3cdf | 2022-07-06 12:03:00 | [diff] [blame] | 1930 | #include <__algorithm/ranges_remove.h> |
Nikolas Klauser | 760d2b4 | 2022-08-03 05:13:59 | [diff] [blame] | 1931 | #include <__algorithm/ranges_remove_copy.h> |
| 1932 | #include <__algorithm/ranges_remove_copy_if.h> |
Nikolas Klauser | f8cbe3cdf | 2022-07-06 12:03:00 | [diff] [blame] | 1933 | #include <__algorithm/ranges_remove_if.h> |
Nikolas Klauser | ff6d5de | 2022-06-07 07:42:10 | [diff] [blame] | 1934 | #include <__algorithm/ranges_replace.h> |
Nikolas Klauser | 93172c1 | 2022-08-03 05:25:00 | [diff] [blame] | 1935 | #include <__algorithm/ranges_replace_copy.h> |
| 1936 | #include <__algorithm/ranges_replace_copy_if.h> |
Nikolas Klauser | ff6d5de | 2022-06-07 07:42:10 | [diff] [blame] | 1937 | #include <__algorithm/ranges_replace_if.h> |
Nikolas Klauser | 1d1a191 | 2022-05-24 08:32:50 | [diff] [blame] | 1938 | #include <__algorithm/ranges_reverse.h> |
Nikolas Klauser | 7d426a3 | 2022-07-11 15:07:35 | [diff] [blame] | 1939 | #include <__algorithm/ranges_reverse_copy.h> |
Konstantin Varlamov | 36c746c | 2022-08-03 23:04:14 | [diff] [blame] | 1940 | #include <__algorithm/ranges_rotate.h> |
Nikolas Klauser | 7d426a3 | 2022-07-11 15:07:35 | [diff] [blame] | 1941 | #include <__algorithm/ranges_rotate_copy.h> |
Konstantin Varlamov | 6bdb642 | 2022-08-03 05:33:12 | [diff] [blame] | 1942 | #include <__algorithm/ranges_sample.h> |
Nikolas Klauser | 101d1e9 | 2022-07-13 16:07:26 | [diff] [blame] | 1943 | #include <__algorithm/ranges_search.h> |
| 1944 | #include <__algorithm/ranges_search_n.h> |
Hui Xie | 1cdec6c | 2022-06-26 15:13:43 | [diff] [blame] | 1945 | #include <__algorithm/ranges_set_difference.h> |
Hui Xie | 96b674f | 2022-07-08 14:21:40 | [diff] [blame] | 1946 | #include <__algorithm/ranges_set_intersection.h> |
Hui Xie | a5c0638 | 2022-07-11 22:39:59 | [diff] [blame] | 1947 | #include <__algorithm/ranges_set_symmetric_difference.h> |
Hui Xie | 3151b95 | 2022-07-13 16:20:22 | [diff] [blame] | 1948 | #include <__algorithm/ranges_set_union.h> |
Konstantin Varlamov | 14cf74d | 2022-07-22 16:58:56 | [diff] [blame] | 1949 | #include <__algorithm/ranges_shuffle.h> |
Konstantin Varlamov | ff3989e | 2022-06-16 22:20:53 | [diff] [blame] | 1950 | #include <__algorithm/ranges_sort.h> |
Konstantin Varlamov | c945bd0 | 2022-07-08 20:46:27 | [diff] [blame] | 1951 | #include <__algorithm/ranges_sort_heap.h> |
Konstantin Varlamov | 8ed702b | 2022-07-19 04:05:51 | [diff] [blame] | 1952 | #include <__algorithm/ranges_stable_partition.h> |
Konstantin Varlamov | 94c7b89 | 2022-07-01 23:34:08 | [diff] [blame] | 1953 | #include <__algorithm/ranges_stable_sort.h> |
zijunzhao | 2051755 | 2023-05-08 22:04:00 | [diff] [blame] | 1954 | #include <__algorithm/ranges_starts_with.h> |
Nikolas Klauser | 9d90531 | 2022-02-10 12:33:03 | [diff] [blame] | 1955 | #include <__algorithm/ranges_swap_ranges.h> |
Nikolas Klauser | 3ba8548 | 2022-04-05 09:05:36 | [diff] [blame] | 1956 | #include <__algorithm/ranges_transform.h> |
Hui Xie | 72f57e3 | 2022-07-23 00:44:25 | [diff] [blame] | 1957 | #include <__algorithm/ranges_unique.h> |
| 1958 | #include <__algorithm/ranges_unique_copy.h> |
Nikolas Klauser | 8171586 | 2022-06-05 19:15:16 | [diff] [blame] | 1959 | #include <__algorithm/ranges_upper_bound.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1960 | #include <__algorithm/remove.h> |
| 1961 | #include <__algorithm/remove_copy.h> |
| 1962 | #include <__algorithm/remove_copy_if.h> |
| 1963 | #include <__algorithm/remove_if.h> |
| 1964 | #include <__algorithm/replace.h> |
| 1965 | #include <__algorithm/replace_copy.h> |
| 1966 | #include <__algorithm/replace_copy_if.h> |
| 1967 | #include <__algorithm/replace_if.h> |
| 1968 | #include <__algorithm/reverse.h> |
| 1969 | #include <__algorithm/reverse_copy.h> |
| 1970 | #include <__algorithm/rotate.h> |
| 1971 | #include <__algorithm/rotate_copy.h> |
| 1972 | #include <__algorithm/sample.h> |
| 1973 | #include <__algorithm/search.h> |
| 1974 | #include <__algorithm/search_n.h> |
| 1975 | #include <__algorithm/set_difference.h> |
| 1976 | #include <__algorithm/set_intersection.h> |
| 1977 | #include <__algorithm/set_symmetric_difference.h> |
| 1978 | #include <__algorithm/set_union.h> |
| 1979 | #include <__algorithm/shift_left.h> |
| 1980 | #include <__algorithm/shift_right.h> |
| 1981 | #include <__algorithm/shuffle.h> |
| 1982 | #include <__algorithm/sift_down.h> |
| 1983 | #include <__algorithm/sort.h> |
| 1984 | #include <__algorithm/sort_heap.h> |
| 1985 | #include <__algorithm/stable_partition.h> |
| 1986 | #include <__algorithm/stable_sort.h> |
Christopher Di Bella | 6adbc83 | 2021-06-05 02:47:47 | [diff] [blame] | 1987 | #include <__algorithm/swap_ranges.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1988 | #include <__algorithm/transform.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1989 | #include <__algorithm/unique.h> |
Arthur O'Dwyer | 4d81a46 | 2022-01-07 14:45:05 | [diff] [blame] | 1990 | #include <__algorithm/unique_copy.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 1991 | #include <__algorithm/unwrap_iter.h> |
| 1992 | #include <__algorithm/upper_bound.h> |
Eric Fiselier | c1bd919 | 2014-08-10 23:53:08 | [diff] [blame] | 1993 | |
Nikolas Klauser | db1978b | 2022-06-16 20:43:46 | [diff] [blame] | 1994 | // standard-mandated includes |
Nikolas Klauser | 473a160 | 2022-09-22 16:05:08 | [diff] [blame] | 1995 | |
| 1996 | // [algorithm.syn] |
Nikolas Klauser | db1978b | 2022-06-16 20:43:46 | [diff] [blame] | 1997 | #include <initializer_list> |
| 1998 | |
Howard Hinnant | 073458b | 2011-10-17 20:05:10 | [diff] [blame] | 1999 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Arthur O'Dwyer | fa6b9e4 | 2022-02-02 01:16:40 | [diff] [blame] | 2000 | # pragma GCC system_header |
Howard Hinnant | 073458b | 2011-10-17 20:05:10 | [diff] [blame] | 2001 | #endif |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 2002 | |
Mark de Wever | e31c2a1 | 2022-09-02 15:53:28 | [diff] [blame] | 2003 | #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 |
Nikolas Klauser | d5e2677 | 2022-09-04 22:01:15 | [diff] [blame] | 2004 | # include <atomic> |
Nikolas Klauser | 40a20ae | 2023-01-08 14:26:32 | [diff] [blame] | 2005 | # include <bit> |
Nikolas Klauser | 89b356f | 2022-11-02 19:27:42 | [diff] [blame] | 2006 | # include <concepts> |
Nikolas Klauser | 75196f8 | 2023-01-08 15:47:53 | [diff] [blame] | 2007 | # include <cstdlib> |
varconst | 5629d49 | 2023-01-14 00:56:58 | [diff] [blame] | 2008 | # include <cstring> |
Mark de Wever | e31c2a1 | 2022-09-02 15:53:28 | [diff] [blame] | 2009 | # include <iterator> |
Nikolas Klauser | d5e2677 | 2022-09-04 22:01:15 | [diff] [blame] | 2010 | # include <memory> |
| 2011 | # include <stdexcept> |
Nikolas Klauser | e698c59 | 2022-12-26 15:24:01 | [diff] [blame] | 2012 | # include <type_traits> |
Mark de Wever | e31c2a1 | 2022-09-02 15:53:28 | [diff] [blame] | 2013 | # include <utility> |
| 2014 | #endif |
| 2015 | |
Louis Dionne | 4cd6ca1 | 2021-04-20 16:03:32 | [diff] [blame] | 2016 | #endif // _LIBCPP_ALGORITHM |