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