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