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