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 { |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 22 | template <class I, class F> |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 23 | struct in_fun_result; // since C++20 |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 24 | |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 25 | template <class I1, class I2> |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 26 | struct in_in_result; // since C++20 |
Nikolas Klauser | f3514af | 2022-01-25 10:21:47 | [diff] [blame] | 27 | |
| 28 | template <class I1, class I2, class O> |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 29 | struct in_in_out_result; // since C++20 |
Nikolas Klauser | 610979b | 2022-02-03 01:17:03 | [diff] [blame] | 30 | |
| 31 | template <class I, class O1, class O2> |
| 32 | struct in_out_out_result; // since C++20 |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 33 | |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 34 | template <class I1, class I2> |
| 35 | struct min_max_result; // since C++20 |
| 36 | |
Nikolas Klauser | 68f4131 | 2022-02-21 22:07:02 | [diff] [blame] | 37 | template <class I> |
| 38 | struct in_found_result; // since C++20 |
| 39 | |
Nikolas Klauser | 3b470d1 | 2022-02-11 12:11:57 | [diff] [blame] | 40 | template<forward_iterator I, sentinel_for<I> S, class Proj = identity, |
| 41 | indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> // since C++20 |
| 42 | constexpr I min_element(I first, S last, Comp comp = {}, Proj proj = {}); |
| 43 | |
| 44 | template<forward_range R, class Proj = identity, |
| 45 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> // since C++20 |
| 46 | constexpr borrowed_iterator_t<R> min_element(R&& r, Comp comp = {}, Proj proj = {}); |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 47 | |
| 48 | template <input_iterator I1, sentinel_for<_I1> S1, input_iterator I2, sentinel_for<_I2> S2, |
| 49 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 50 | requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> |
| 51 | constexpr mismatch_result<_I1, _I2> |
| 52 | mismatch()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20 |
| 53 | |
| 54 | template <input_range R1, input_range R2, |
| 55 | class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> |
| 56 | requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> |
| 57 | constexpr mismatch_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> |
| 58 | 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] | 59 | |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 60 | requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> |
| 61 | constexpr I find(I first, S last, const T& value, Proj proj = {}); // since C++20 |
| 62 | |
| 63 | template<input_range R, class T, class Proj = identity> |
| 64 | requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> |
| 65 | constexpr borrowed_iterator_t<R> |
| 66 | find(R&& r, const T& value, Proj proj = {}); // since C++20 |
| 67 | |
| 68 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 69 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 70 | constexpr I find_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 71 | |
| 72 | template<input_range R, class Proj = identity, |
| 73 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 74 | constexpr borrowed_iterator_t<R> |
| 75 | find_if(R&& r, Pred pred, Proj proj = {}); // since C++20 |
| 76 | |
| 77 | template<input_iterator I, sentinel_for<I> S, class Proj = identity, |
| 78 | indirect_unary_predicate<projected<I, Proj>> Pred> |
| 79 | constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {}); // since C++20 |
| 80 | |
| 81 | template<input_range R, class Proj = identity, |
| 82 | indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> |
| 83 | constexpr borrowed_iterator_t<R> |
| 84 | find_if_not(R&& r, Pred pred, Proj proj = {}); // since C++20 |
Nikolas Klauser | f83d833 | 2022-03-18 01:57:08 | [diff] [blame] | 85 | |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame^] | 86 | template<class T, class Proj = identity, |
| 87 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 88 | 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] | 89 | |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame^] | 90 | template<copyable T, class Proj = identity, |
| 91 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 92 | 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] | 93 | |
| 94 | template<input_range R, class Proj = identity, |
| 95 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 96 | requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> |
| 97 | constexpr range_value_t<R> |
| 98 | min(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame^] | 99 | |
| 100 | template<class T, class Proj = identity, |
| 101 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 102 | constexpr const T& max(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 |
| 103 | |
| 104 | template<copyable T, class Proj = identity, |
| 105 | indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> |
| 106 | constexpr T max(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20 |
| 107 | |
| 108 | template<input_range R, class Proj = identity, |
| 109 | indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> |
| 110 | requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> |
| 111 | constexpr range_value_t<R> |
| 112 | max(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 113 | } |
| 114 | |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 115 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 116 | all_of(InputIterator first, InputIterator last, Predicate pred); |
| 117 | |
| 118 | template <class InputIterator, class Predicate> |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 119 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 120 | any_of(InputIterator first, InputIterator last, Predicate pred); |
| 121 | |
| 122 | template <class InputIterator, class Predicate> |
Marshall Clow | 706ffef | 2018-01-15 17:20:36 | [diff] [blame] | 123 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 124 | none_of(InputIterator first, InputIterator last, Predicate pred); |
| 125 | |
| 126 | template <class InputIterator, class Function> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 127 | constexpr Function // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 128 | for_each(InputIterator first, InputIterator last, Function f); |
| 129 | |
Marshall Clow | d5c65ff | 2017-05-25 02:29:54 | [diff] [blame] | 130 | template<class InputIterator, class Size, class Function> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 131 | constexpr InputIterator // constexpr in C++20 |
| 132 | for_each_n(InputIterator first, Size n, Function f); // C++17 |
Marshall Clow | d5c65ff | 2017-05-25 02:29:54 | [diff] [blame] | 133 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 134 | template <class InputIterator, class T> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 135 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 136 | find(InputIterator first, InputIterator last, const T& value); |
| 137 | |
| 138 | template <class InputIterator, class Predicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 139 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 140 | find_if(InputIterator first, InputIterator last, Predicate pred); |
| 141 | |
| 142 | template<class InputIterator, class Predicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 143 | constexpr InputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 144 | find_if_not(InputIterator first, InputIterator last, Predicate pred); |
| 145 | |
| 146 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 147 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 148 | find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 149 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 150 | |
| 151 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 152 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 153 | find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 154 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 155 | |
| 156 | template <class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 157 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 158 | find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, |
| 159 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 160 | |
| 161 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 162 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 163 | find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, |
| 164 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 165 | |
| 166 | template <class ForwardIterator> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 167 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 168 | adjacent_find(ForwardIterator first, ForwardIterator last); |
| 169 | |
| 170 | template <class ForwardIterator, class BinaryPredicate> |
Marshall Clow | 8694428 | 2018-01-15 19:26:05 | [diff] [blame] | 171 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 172 | adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); |
| 173 | |
| 174 | template <class InputIterator, class T> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 175 | constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 176 | count(InputIterator first, InputIterator last, const T& value); |
| 177 | |
| 178 | template <class InputIterator, class Predicate> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 179 | constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 180 | count_if(InputIterator first, InputIterator last, Predicate pred); |
| 181 | |
| 182 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 183 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 184 | mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); |
| 185 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 186 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 187 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Aditya Kumar | 331fb80 | 2016-08-25 11:52:38 | [diff] [blame] | 188 | mismatch(InputIterator1 first1, InputIterator1 last1, |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 189 | InputIterator2 first2, InputIterator2 last2); // **C++14** |
| 190 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 191 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 192 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 193 | mismatch(InputIterator1 first1, InputIterator1 last1, |
| 194 | InputIterator2 first2, BinaryPredicate pred); |
| 195 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 196 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 197 | constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 198 | mismatch(InputIterator1 first1, InputIterator1 last1, |
| 199 | InputIterator2 first2, InputIterator2 last2, |
| 200 | BinaryPredicate pred); // **C++14** |
| 201 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 202 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 203 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 204 | equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); |
| 205 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 206 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 207 | constexpr bool // constexpr in C++20 |
Aditya Kumar | 331fb80 | 2016-08-25 11:52:38 | [diff] [blame] | 208 | equal(InputIterator1 first1, InputIterator1 last1, |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 209 | InputIterator2 first2, InputIterator2 last2); // **C++14** |
| 210 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 211 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 212 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 213 | equal(InputIterator1 first1, InputIterator1 last1, |
| 214 | InputIterator2 first2, BinaryPredicate pred); |
| 215 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 216 | template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
Marshall Clow | 6538e28d | 2018-01-16 02:04:10 | [diff] [blame] | 217 | constexpr bool // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 218 | equal(InputIterator1 first1, InputIterator1 last1, |
| 219 | InputIterator2 first2, InputIterator2 last2, |
| 220 | BinaryPredicate pred); // **C++14** |
| 221 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 222 | template<class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 223 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 224 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 225 | ForwardIterator2 first2); |
| 226 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 227 | template<class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 228 | constexpr bool // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 229 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 230 | ForwardIterator2 first2, ForwardIterator2 last2); // **C++14** |
| 231 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 232 | template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 233 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 234 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 235 | ForwardIterator2 first2, BinaryPredicate pred); |
| 236 | |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 237 | template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 238 | constexpr bool // constexpr in C++20 |
Marshall Clow | 0b0bbd2 | 2013-05-09 21:14:23 | [diff] [blame] | 239 | is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, |
| 240 | ForwardIterator2 first2, ForwardIterator2 last2, |
| 241 | BinaryPredicate pred); // **C++14** |
| 242 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 243 | template <class ForwardIterator1, class ForwardIterator2> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 244 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 245 | search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 246 | ForwardIterator2 first2, ForwardIterator2 last2); |
| 247 | |
| 248 | template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 249 | constexpr ForwardIterator1 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 250 | search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 251 | ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); |
| 252 | |
| 253 | template <class ForwardIterator, class Size, class T> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 254 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 255 | search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value); |
| 256 | |
| 257 | template <class ForwardIterator, class Size, class T, class BinaryPredicate> |
Marshall Clow | 12f0a77 | 2018-01-16 15:48:27 | [diff] [blame] | 258 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 259 | search_n(ForwardIterator first, ForwardIterator last, |
| 260 | Size count, const T& value, BinaryPredicate pred); |
| 261 | |
| 262 | template <class InputIterator, class OutputIterator> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 263 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 264 | copy(InputIterator first, InputIterator last, OutputIterator result); |
| 265 | |
| 266 | template<class InputIterator, class OutputIterator, class Predicate> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 267 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 268 | copy_if(InputIterator first, InputIterator last, |
| 269 | OutputIterator result, Predicate pred); |
| 270 | |
| 271 | template<class InputIterator, class Size, class OutputIterator> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 272 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 273 | copy_n(InputIterator first, Size n, OutputIterator result); |
| 274 | |
| 275 | template <class BidirectionalIterator1, class BidirectionalIterator2> |
Louis Dionne | 13c90a5 | 2019-11-06 12:02:41 | [diff] [blame] | 276 | constexpr BidirectionalIterator2 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 277 | copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, |
| 278 | BidirectionalIterator2 result); |
| 279 | |
| 280 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 281 | constexpr ForwardIterator2 // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 282 | swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); |
| 283 | |
Nikolas Klauser | 9d90531 | 2022-02-10 12:33:03 | [diff] [blame] | 284 | template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2> |
| 285 | requires indirectly_swappable<I1, I2> |
| 286 | constexpr ranges::swap_ranges_result<I1, I2> |
| 287 | ranges::swap_ranges(I1 first1, S1 last1, I2 first2, S2 last2); |
| 288 | |
| 289 | template<input_range R1, input_range R2> |
| 290 | requires indirectly_swappable<iterator_t<R1>, iterator_t<R2>> |
| 291 | constexpr ranges::swap_ranges_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> |
| 292 | ranges::swap_ranges(R1&& r1, R2&& r2); |
| 293 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 294 | template <class ForwardIterator1, class ForwardIterator2> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 295 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 296 | iter_swap(ForwardIterator1 a, ForwardIterator2 b); |
| 297 | |
| 298 | template <class InputIterator, class OutputIterator, class UnaryOperation> |
Marshall Clow | 99894b6 | 2018-01-19 17:45:39 | [diff] [blame] | 299 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 300 | transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op); |
| 301 | |
| 302 | template <class InputIterator1, class InputIterator2, class OutputIterator, class BinaryOperation> |
Marshall Clow | 99894b6 | 2018-01-19 17:45:39 | [diff] [blame] | 303 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 304 | transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, |
| 305 | OutputIterator result, BinaryOperation binary_op); |
| 306 | |
| 307 | template <class ForwardIterator, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 308 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 309 | replace(ForwardIterator first, ForwardIterator last, const T& old_value, const T& new_value); |
| 310 | |
| 311 | template <class ForwardIterator, class Predicate, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 312 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 313 | replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value); |
| 314 | |
| 315 | template <class InputIterator, class OutputIterator, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 316 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 317 | replace_copy(InputIterator first, InputIterator last, OutputIterator result, |
| 318 | const T& old_value, const T& new_value); |
| 319 | |
| 320 | template <class InputIterator, class OutputIterator, class Predicate, class T> |
Marshall Clow | 12c7423 | 2018-01-19 18:07:29 | [diff] [blame] | 321 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 322 | replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, const T& new_value); |
| 323 | |
| 324 | template <class ForwardIterator, class T> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 325 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 326 | fill(ForwardIterator first, ForwardIterator last, const T& value); |
| 327 | |
| 328 | template <class OutputIterator, class Size, class T> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 329 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 330 | fill_n(OutputIterator first, Size n, const T& value); |
| 331 | |
| 332 | template <class ForwardIterator, class Generator> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 333 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 334 | generate(ForwardIterator first, ForwardIterator last, Generator gen); |
| 335 | |
| 336 | template <class OutputIterator, class Size, class Generator> |
Marshall Clow | 4bfb931 | 2018-01-20 20:14:32 | [diff] [blame] | 337 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 338 | generate_n(OutputIterator first, Size n, Generator gen); |
| 339 | |
| 340 | template <class ForwardIterator, class T> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 341 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 342 | remove(ForwardIterator first, ForwardIterator last, const T& value); |
| 343 | |
| 344 | template <class ForwardIterator, class Predicate> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 345 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 346 | remove_if(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 347 | |
| 348 | template <class InputIterator, class OutputIterator, class T> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 349 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 350 | remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value); |
| 351 | |
| 352 | template <class InputIterator, class OutputIterator, class Predicate> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 353 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 354 | remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred); |
| 355 | |
| 356 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 357 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 358 | unique(ForwardIterator first, ForwardIterator last); |
| 359 | |
| 360 | template <class ForwardIterator, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 361 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 362 | unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); |
| 363 | |
| 364 | template <class InputIterator, class OutputIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 365 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 366 | unique_copy(InputIterator first, InputIterator last, OutputIterator result); |
| 367 | |
| 368 | template <class InputIterator, class OutputIterator, class BinaryPredicate> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 369 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 370 | unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred); |
| 371 | |
| 372 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 373 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 374 | reverse(BidirectionalIterator first, BidirectionalIterator last); |
| 375 | |
| 376 | template <class BidirectionalIterator, class OutputIterator> |
Marshall Clow | e8ea829 | 2018-01-22 21:43:04 | [diff] [blame] | 377 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 378 | reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result); |
| 379 | |
| 380 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 381 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 382 | rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last); |
| 383 | |
| 384 | template <class ForwardIterator, class OutputIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 385 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 386 | rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result); |
| 387 | |
| 388 | template <class RandomAccessIterator> |
| 389 | void |
Marshall Clow | 0f37a41 | 2017-03-23 13:43:37 | [diff] [blame] | 390 | 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] | 391 | |
| 392 | template <class RandomAccessIterator, class RandomNumberGenerator> |
| 393 | void |
Marshall Clow | 06965c1 | 2014-03-03 06:14:19 | [diff] [blame] | 394 | random_shuffle(RandomAccessIterator first, RandomAccessIterator last, |
Marshall Clow | 0f37a41 | 2017-03-23 13:43:37 | [diff] [blame] | 395 | RandomNumberGenerator& rand); // deprecated in C++14, removed in C++17 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 396 | |
Eric Fiselier | e715470 | 2016-08-28 22:14:37 | [diff] [blame] | 397 | template<class PopulationIterator, class SampleIterator, |
| 398 | class Distance, class UniformRandomBitGenerator> |
| 399 | SampleIterator sample(PopulationIterator first, PopulationIterator last, |
| 400 | SampleIterator out, Distance n, |
| 401 | UniformRandomBitGenerator&& g); // C++17 |
| 402 | |
Howard Hinnant | f9d540b | 2010-05-26 17:49:34 | [diff] [blame] | 403 | template<class RandomAccessIterator, class UniformRandomNumberGenerator> |
| 404 | void shuffle(RandomAccessIterator first, RandomAccessIterator last, |
Howard Hinnant | fb34010 | 2010-11-18 01:47:02 | [diff] [blame] | 405 | UniformRandomNumberGenerator&& g); |
Howard Hinnant | f9d540b | 2010-05-26 17:49:34 | [diff] [blame] | 406 | |
Arthur O'Dwyer | 3fbd3ea | 2020-12-26 06:39:03 | [diff] [blame] | 407 | template<class ForwardIterator> |
| 408 | constexpr ForwardIterator |
| 409 | shift_left(ForwardIterator first, ForwardIterator last, |
| 410 | typename iterator_traits<ForwardIterator>::difference_type n); // C++20 |
| 411 | |
| 412 | template<class ForwardIterator> |
| 413 | constexpr ForwardIterator |
| 414 | shift_right(ForwardIterator first, ForwardIterator last, |
| 415 | typename iterator_traits<ForwardIterator>::difference_type n); // C++20 |
| 416 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 417 | template <class InputIterator, class Predicate> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 418 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 419 | is_partitioned(InputIterator first, InputIterator last, Predicate pred); |
| 420 | |
| 421 | template <class ForwardIterator, class Predicate> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 422 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 423 | partition(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 424 | |
| 425 | template <class InputIterator, class OutputIterator1, |
| 426 | class OutputIterator2, class Predicate> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 427 | constexpr pair<OutputIterator1, OutputIterator2> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 428 | partition_copy(InputIterator first, InputIterator last, |
| 429 | OutputIterator1 out_true, OutputIterator2 out_false, |
| 430 | Predicate pred); |
| 431 | |
| 432 | template <class ForwardIterator, class Predicate> |
| 433 | ForwardIterator |
| 434 | stable_partition(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 435 | |
| 436 | template<class ForwardIterator, class Predicate> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 437 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 438 | partition_point(ForwardIterator first, ForwardIterator last, Predicate pred); |
| 439 | |
| 440 | template <class ForwardIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 441 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 442 | is_sorted(ForwardIterator first, ForwardIterator last); |
| 443 | |
| 444 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 445 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 446 | is_sorted(ForwardIterator first, ForwardIterator last, Compare comp); |
| 447 | |
| 448 | template<class ForwardIterator> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 449 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 450 | is_sorted_until(ForwardIterator first, ForwardIterator last); |
| 451 | |
| 452 | template <class ForwardIterator, class Compare> |
Marshall Clow | 056f15e | 2018-01-15 19:40:34 | [diff] [blame] | 453 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 454 | is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp); |
| 455 | |
| 456 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 493f140 | 2020-12-20 20:21:42 | [diff] [blame] | 457 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 458 | sort(RandomAccessIterator first, RandomAccessIterator last); |
| 459 | |
| 460 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 493f140 | 2020-12-20 20:21:42 | [diff] [blame] | 461 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 462 | sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 463 | |
| 464 | template <class RandomAccessIterator> |
| 465 | void |
| 466 | stable_sort(RandomAccessIterator first, RandomAccessIterator last); |
| 467 | |
| 468 | template <class RandomAccessIterator, class Compare> |
| 469 | void |
| 470 | stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 471 | |
| 472 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 473 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 474 | partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last); |
| 475 | |
| 476 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 477 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 478 | partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp); |
| 479 | |
| 480 | template <class InputIterator, class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 481 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 482 | partial_sort_copy(InputIterator first, InputIterator last, |
| 483 | RandomAccessIterator result_first, RandomAccessIterator result_last); |
| 484 | |
| 485 | template <class InputIterator, class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 486 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 487 | partial_sort_copy(InputIterator first, InputIterator last, |
| 488 | RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp); |
| 489 | |
| 490 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5d95656 | 2021-02-04 23:12:52 | [diff] [blame] | 491 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 492 | nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last); |
| 493 | |
| 494 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5d95656 | 2021-02-04 23:12:52 | [diff] [blame] | 495 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 496 | nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp); |
| 497 | |
| 498 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 499 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 500 | lower_bound(ForwardIterator first, ForwardIterator last, const T& value); |
| 501 | |
| 502 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 503 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 504 | lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 505 | |
| 506 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 507 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 508 | upper_bound(ForwardIterator first, ForwardIterator last, const T& value); |
| 509 | |
| 510 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 511 | constexpr ForwardIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 512 | upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 513 | |
| 514 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 515 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 516 | equal_range(ForwardIterator first, ForwardIterator last, const T& value); |
| 517 | |
| 518 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 519 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 520 | equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 521 | |
| 522 | template <class ForwardIterator, class T> |
Marshall Clow | d57c03d | 2018-01-16 02:34:41 | [diff] [blame] | 523 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 524 | binary_search(ForwardIterator first, ForwardIterator last, const T& value); |
| 525 | |
| 526 | template <class ForwardIterator, class T, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 527 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 528 | binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); |
| 529 | |
| 530 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 531 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 532 | merge(InputIterator1 first1, InputIterator1 last1, |
| 533 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 534 | |
| 535 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 536 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 537 | merge(InputIterator1 first1, InputIterator1 last1, |
| 538 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 539 | |
| 540 | template <class BidirectionalIterator> |
| 541 | void |
| 542 | inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last); |
| 543 | |
| 544 | template <class BidirectionalIterator, class Compare> |
| 545 | void |
| 546 | inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp); |
| 547 | |
| 548 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 549 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 550 | includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); |
| 551 | |
| 552 | template <class InputIterator1, class InputIterator2, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 553 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 554 | includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); |
| 555 | |
| 556 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 557 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 558 | set_union(InputIterator1 first1, InputIterator1 last1, |
| 559 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 560 | |
| 561 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 562 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 563 | set_union(InputIterator1 first1, InputIterator1 last1, |
| 564 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 565 | |
| 566 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 567 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 568 | set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 569 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 570 | |
| 571 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Marshall Clow | 8da1a48 | 2018-01-22 23:10:40 | [diff] [blame] | 572 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 573 | set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 574 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 575 | |
| 576 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 577 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 578 | set_difference(InputIterator1 first1, InputIterator1 last1, |
| 579 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 580 | |
| 581 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 582 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 583 | set_difference(InputIterator1 first1, InputIterator1 last1, |
| 584 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 585 | |
| 586 | template <class InputIterator1, class InputIterator2, class OutputIterator> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 587 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 588 | set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 589 | InputIterator2 first2, InputIterator2 last2, OutputIterator result); |
| 590 | |
| 591 | template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> |
Arthur O'Dwyer | 14098cf | 2020-12-04 18:47:12 | [diff] [blame] | 592 | constexpr OutputIterator // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 593 | set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 594 | InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); |
| 595 | |
| 596 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 597 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 598 | push_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 599 | |
| 600 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 601 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 602 | push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 603 | |
| 604 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 605 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 606 | pop_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 607 | |
| 608 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 609 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 610 | pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 611 | |
| 612 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 613 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 614 | make_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 615 | |
| 616 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 617 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 618 | make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 619 | |
| 620 | template <class RandomAccessIterator> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 621 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 622 | sort_heap(RandomAccessIterator first, RandomAccessIterator last); |
| 623 | |
| 624 | template <class RandomAccessIterator, class Compare> |
Arthur O'Dwyer | 5386aa2 | 2020-12-17 05:26:18 | [diff] [blame] | 625 | constexpr void // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 626 | sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); |
| 627 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 628 | template <class RandomAccessIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 629 | constexpr bool // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 630 | is_heap(RandomAccessIterator first, RandomAccessiterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 631 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 632 | template <class RandomAccessIterator, class Compare> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 633 | constexpr bool // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 634 | is_heap(RandomAccessIterator first, RandomAccessiterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 635 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 636 | template <class RandomAccessIterator> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 637 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 638 | is_heap_until(RandomAccessIterator first, RandomAccessiterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 639 | |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 640 | template <class RandomAccessIterator, class Compare> |
Marshall Clow | 49c7643 | 2018-01-15 16:16:32 | [diff] [blame] | 641 | constexpr RandomAccessIterator // constexpr in C++20 |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 642 | is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 643 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 644 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 645 | constexpr ForwardIterator // constexpr in C++14 |
| 646 | min_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 647 | |
| 648 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 649 | constexpr ForwardIterator // constexpr in C++14 |
| 650 | min_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 651 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 652 | template <class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 653 | constexpr const T& // constexpr in C++14 |
| 654 | min(const T& a, const T& b); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 655 | |
| 656 | template <class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 657 | constexpr const T& // constexpr in C++14 |
| 658 | min(const T& a, const T& b, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 659 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 660 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 661 | constexpr T // constexpr in C++14 |
| 662 | min(initializer_list<T> t); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 663 | |
| 664 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 665 | constexpr T // constexpr in C++14 |
| 666 | min(initializer_list<T> t, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 667 | |
Marshall Clow | 146c14a | 2016-03-07 22:43:49 | [diff] [blame] | 668 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 669 | 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] | 670 | |
| 671 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 672 | 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] | 673 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 674 | template <class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 675 | constexpr ForwardIterator // constexpr in C++14 |
| 676 | max_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 677 | |
| 678 | template <class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 679 | constexpr ForwardIterator // constexpr in C++14 |
| 680 | max_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 681 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 682 | template <class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 683 | constexpr const T& // constexpr in C++14 |
| 684 | max(const T& a, const T& b); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 685 | |
| 686 | template <class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 687 | constexpr const T& // constexpr in C++14 |
| 688 | max(const T& a, const T& b, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 689 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 690 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 691 | constexpr T // constexpr in C++14 |
| 692 | max(initializer_list<T> t); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 693 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 694 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 695 | constexpr T // constexpr in C++14 |
| 696 | max(initializer_list<T> t, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 697 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 698 | template<class ForwardIterator> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 699 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 |
| 700 | minmax_element(ForwardIterator first, ForwardIterator last); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 701 | |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 702 | template<class ForwardIterator, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 703 | constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 |
| 704 | minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 705 | |
| 706 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 707 | constexpr pair<const T&, const T&> // constexpr in C++14 |
| 708 | minmax(const T& a, const T& b); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 709 | |
| 710 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 711 | constexpr pair<const T&, const T&> // constexpr in C++14 |
| 712 | minmax(const T& a, const T& b, Compare comp); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 713 | |
| 714 | template<class T> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 715 | constexpr pair<T, T> // constexpr in C++14 |
| 716 | minmax(initializer_list<T> t); |
Howard Hinnant | 4eb27b7 | 2010-08-21 20:10:01 | [diff] [blame] | 717 | |
| 718 | template<class T, class Compare> |
Arthur O'Dwyer | b8bc4e1 | 2020-12-03 01:02:18 | [diff] [blame] | 719 | constexpr pair<T, T> // constexpr in C++14 |
| 720 | minmax(initializer_list<T> t, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 721 | |
| 722 | template <class InputIterator1, class InputIterator2> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 723 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 724 | lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); |
| 725 | |
| 726 | template <class InputIterator1, class InputIterator2, class Compare> |
Marshall Clow | 1b9a4ff | 2018-01-22 20:44:33 | [diff] [blame] | 727 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 728 | lexicographical_compare(InputIterator1 first1, InputIterator1 last1, |
| 729 | InputIterator2 first2, InputIterator2 last2, Compare comp); |
| 730 | |
| 731 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 732 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 733 | next_permutation(BidirectionalIterator first, BidirectionalIterator last); |
| 734 | |
| 735 | template <class BidirectionalIterator, class Compare> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 736 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 737 | next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); |
| 738 | |
| 739 | template <class BidirectionalIterator> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 740 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 741 | prev_permutation(BidirectionalIterator first, BidirectionalIterator last); |
| 742 | |
| 743 | template <class BidirectionalIterator, class Compare> |
Arthur O'Dwyer | f851db3 | 2020-12-17 05:01:08 | [diff] [blame] | 744 | constexpr bool // constexpr in C++20 |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 745 | prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 746 | } // std |
| 747 | |
| 748 | */ |
| 749 | |
Louis Dionne | 385cc25 | 2022-03-25 16:55:36 | [diff] [blame] | 750 | #include <__assert> // all public C++ headers provide the assertion handler |
Arthur O'Dwyer | ea2206d | 2022-02-04 18:09:30 | [diff] [blame] | 751 | #include <__bits> |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 752 | #include <__config> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 753 | #include <__debug> |
Howard Hinnant | a1d07d5 | 2012-07-26 17:09:09 | [diff] [blame] | 754 | #include <cstddef> |
Arthur O'Dwyer | bfbd73f | 2021-05-19 15:57:04 | [diff] [blame] | 755 | #include <cstring> |
| 756 | #include <functional> |
| 757 | #include <initializer_list> |
Arthur O'Dwyer | bfbd73f | 2021-05-19 15:57:04 | [diff] [blame] | 758 | #include <iterator> |
| 759 | #include <memory> |
| 760 | #include <type_traits> |
Marshall Clow | f56972e | 2018-09-12 19:41:40 | [diff] [blame] | 761 | #include <version> |
Howard Hinnant | 5d1a701 | 2013-08-14 18:00:20 | [diff] [blame] | 762 | |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 763 | #include <__algorithm/adjacent_find.h> |
| 764 | #include <__algorithm/all_of.h> |
| 765 | #include <__algorithm/any_of.h> |
| 766 | #include <__algorithm/binary_search.h> |
| 767 | #include <__algorithm/clamp.h> |
| 768 | #include <__algorithm/comp.h> |
| 769 | #include <__algorithm/comp_ref_type.h> |
| 770 | #include <__algorithm/copy.h> |
| 771 | #include <__algorithm/copy_backward.h> |
| 772 | #include <__algorithm/copy_if.h> |
| 773 | #include <__algorithm/copy_n.h> |
| 774 | #include <__algorithm/count.h> |
| 775 | #include <__algorithm/count_if.h> |
| 776 | #include <__algorithm/equal.h> |
| 777 | #include <__algorithm/equal_range.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 778 | #include <__algorithm/fill.h> |
Arthur O'Dwyer | 4d81a46 | 2022-01-07 14:45:05 | [diff] [blame] | 779 | #include <__algorithm/fill_n.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 780 | #include <__algorithm/find.h> |
| 781 | #include <__algorithm/find_end.h> |
| 782 | #include <__algorithm/find_first_of.h> |
| 783 | #include <__algorithm/find_if.h> |
| 784 | #include <__algorithm/find_if_not.h> |
| 785 | #include <__algorithm/for_each.h> |
| 786 | #include <__algorithm/for_each_n.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 787 | #include <__algorithm/generate.h> |
Arthur O'Dwyer | 4d81a46 | 2022-01-07 14:45:05 | [diff] [blame] | 788 | #include <__algorithm/generate_n.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 789 | #include <__algorithm/half_positive.h> |
Nikolas Klauser | 68f4131 | 2022-02-21 22:07:02 | [diff] [blame] | 790 | #include <__algorithm/in_found_result.h> |
Nikolas Klauser | 1e77b39 | 2022-02-11 16:01:58 | [diff] [blame] | 791 | #include <__algorithm/in_fun_result.h> |
Nikolas Klauser | f3514af | 2022-01-25 10:21:47 | [diff] [blame] | 792 | #include <__algorithm/in_in_out_result.h> |
Nikolas Klauser | d3729bb | 2022-01-14 01:55:51 | [diff] [blame] | 793 | #include <__algorithm/in_in_result.h> |
Nikolas Klauser | 610979b | 2022-02-03 01:17:03 | [diff] [blame] | 794 | #include <__algorithm/in_out_out_result.h> |
Konstantin Varlamov | 8d23b74 | 2022-01-11 06:49:37 | [diff] [blame] | 795 | #include <__algorithm/in_out_result.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 796 | #include <__algorithm/includes.h> |
| 797 | #include <__algorithm/inplace_merge.h> |
| 798 | #include <__algorithm/is_heap.h> |
| 799 | #include <__algorithm/is_heap_until.h> |
| 800 | #include <__algorithm/is_partitioned.h> |
| 801 | #include <__algorithm/is_permutation.h> |
| 802 | #include <__algorithm/is_sorted.h> |
| 803 | #include <__algorithm/is_sorted_until.h> |
Christopher Di Bella | 6adbc83 | 2021-06-05 02:47:47 | [diff] [blame] | 804 | #include <__algorithm/iter_swap.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 805 | #include <__algorithm/lexicographical_compare.h> |
| 806 | #include <__algorithm/lower_bound.h> |
| 807 | #include <__algorithm/make_heap.h> |
| 808 | #include <__algorithm/max.h> |
| 809 | #include <__algorithm/max_element.h> |
| 810 | #include <__algorithm/merge.h> |
| 811 | #include <__algorithm/min.h> |
| 812 | #include <__algorithm/min_element.h> |
Nikolas Klauser | 807766b | 2022-02-21 21:48:36 | [diff] [blame] | 813 | #include <__algorithm/min_max_result.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 814 | #include <__algorithm/minmax.h> |
| 815 | #include <__algorithm/minmax_element.h> |
| 816 | #include <__algorithm/mismatch.h> |
| 817 | #include <__algorithm/move.h> |
| 818 | #include <__algorithm/move_backward.h> |
| 819 | #include <__algorithm/next_permutation.h> |
| 820 | #include <__algorithm/none_of.h> |
| 821 | #include <__algorithm/nth_element.h> |
| 822 | #include <__algorithm/partial_sort.h> |
| 823 | #include <__algorithm/partial_sort_copy.h> |
| 824 | #include <__algorithm/partition.h> |
| 825 | #include <__algorithm/partition_copy.h> |
| 826 | #include <__algorithm/partition_point.h> |
| 827 | #include <__algorithm/pop_heap.h> |
| 828 | #include <__algorithm/prev_permutation.h> |
| 829 | #include <__algorithm/push_heap.h> |
Nikolas Klauser | ee0f8c4 | 2022-03-12 00:45:35 | [diff] [blame] | 830 | #include <__algorithm/ranges_find.h> |
| 831 | #include <__algorithm/ranges_find_if.h> |
| 832 | #include <__algorithm/ranges_find_if_not.h> |
Nikolas Klauser | e476df5 | 2022-04-03 07:17:01 | [diff] [blame^] | 833 | #include <__algorithm/ranges_max.h> |
Nikolas Klauser | 205557c | 2022-03-07 16:01:52 | [diff] [blame] | 834 | #include <__algorithm/ranges_max_element.h> |
Nikolas Klauser | f83d833 | 2022-03-18 01:57:08 | [diff] [blame] | 835 | #include <__algorithm/ranges_min.h> |
Nikolas Klauser | 3b470d1 | 2022-02-11 12:11:57 | [diff] [blame] | 836 | #include <__algorithm/ranges_min_element.h> |
Nikolas Klauser | c2cd15a | 2022-03-08 22:12:35 | [diff] [blame] | 837 | #include <__algorithm/ranges_mismatch.h> |
Nikolas Klauser | 9d90531 | 2022-02-10 12:33:03 | [diff] [blame] | 838 | #include <__algorithm/ranges_swap_ranges.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 839 | #include <__algorithm/remove.h> |
| 840 | #include <__algorithm/remove_copy.h> |
| 841 | #include <__algorithm/remove_copy_if.h> |
| 842 | #include <__algorithm/remove_if.h> |
| 843 | #include <__algorithm/replace.h> |
| 844 | #include <__algorithm/replace_copy.h> |
| 845 | #include <__algorithm/replace_copy_if.h> |
| 846 | #include <__algorithm/replace_if.h> |
| 847 | #include <__algorithm/reverse.h> |
| 848 | #include <__algorithm/reverse_copy.h> |
| 849 | #include <__algorithm/rotate.h> |
| 850 | #include <__algorithm/rotate_copy.h> |
| 851 | #include <__algorithm/sample.h> |
| 852 | #include <__algorithm/search.h> |
| 853 | #include <__algorithm/search_n.h> |
| 854 | #include <__algorithm/set_difference.h> |
| 855 | #include <__algorithm/set_intersection.h> |
| 856 | #include <__algorithm/set_symmetric_difference.h> |
| 857 | #include <__algorithm/set_union.h> |
| 858 | #include <__algorithm/shift_left.h> |
| 859 | #include <__algorithm/shift_right.h> |
| 860 | #include <__algorithm/shuffle.h> |
| 861 | #include <__algorithm/sift_down.h> |
| 862 | #include <__algorithm/sort.h> |
| 863 | #include <__algorithm/sort_heap.h> |
| 864 | #include <__algorithm/stable_partition.h> |
| 865 | #include <__algorithm/stable_sort.h> |
Christopher Di Bella | 6adbc83 | 2021-06-05 02:47:47 | [diff] [blame] | 866 | #include <__algorithm/swap_ranges.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 867 | #include <__algorithm/transform.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 868 | #include <__algorithm/unique.h> |
Arthur O'Dwyer | 4d81a46 | 2022-01-07 14:45:05 | [diff] [blame] | 869 | #include <__algorithm/unique_copy.h> |
Louis Dionne | 134723e | 2021-06-17 15:30:11 | [diff] [blame] | 870 | #include <__algorithm/unwrap_iter.h> |
| 871 | #include <__algorithm/upper_bound.h> |
Eric Fiselier | c1bd919 | 2014-08-10 23:53:08 | [diff] [blame] | 872 | |
Howard Hinnant | 073458b | 2011-10-17 20:05:10 | [diff] [blame] | 873 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Arthur O'Dwyer | fa6b9e4 | 2022-02-02 01:16:40 | [diff] [blame] | 874 | # pragma GCC system_header |
Howard Hinnant | 073458b | 2011-10-17 20:05:10 | [diff] [blame] | 875 | #endif |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 876 | |
Louis Dionne | 0a06eb9 | 2019-08-05 18:29:14 | [diff] [blame] | 877 | #if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17 |
Louis Dionne | 9568924 | 2019-08-06 21:11:24 | [diff] [blame] | 878 | # include <__pstl_algorithm> |
Louis Dionne | 0a06eb9 | 2019-08-05 18:29:14 | [diff] [blame] | 879 | #endif |
| 880 | |
Louis Dionne | 4cd6ca1 | 2021-04-20 16:03:32 | [diff] [blame] | 881 | #endif // _LIBCPP_ALGORITHM |