Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
Christopher Di Bella | 55d7a82 | 2021-07-01 09:25:35 -0400 | [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_FUNCTIONAL |
| 11 | #define _LIBCPP_FUNCTIONAL |
| 12 | |
| 13 | /* |
| 14 | functional synopsis |
| 15 | |
| 16 | namespace std |
| 17 | { |
| 18 | |
| 19 | template <class Arg, class Result> |
| 20 | struct unary_function |
| 21 | { |
| 22 | typedef Arg argument_type; |
| 23 | typedef Result result_type; |
| 24 | }; |
| 25 | |
| 26 | template <class Arg1, class Arg2, class Result> |
| 27 | struct binary_function |
| 28 | { |
| 29 | typedef Arg1 first_argument_type; |
| 30 | typedef Arg2 second_argument_type; |
| 31 | typedef Result result_type; |
| 32 | }; |
| 33 | |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 34 | template <class T> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 35 | class reference_wrapper |
| 36 | : public unary_function<T1, R> // if wrapping a unary functor |
| 37 | : public binary_function<T1, T2, R> // if wraping a binary functor |
| 38 | { |
| 39 | public: |
| 40 | // types |
| 41 | typedef T type; |
| 42 | typedef see below result_type; // Not always defined |
| 43 | |
| 44 | // construct/copy/destroy |
Arthur O'Dwyer | 8fa8794 | 2020-12-05 19:37:41 -0500 | [diff] [blame] | 45 | template<class U> |
| 46 | reference_wrapper(U&&); |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 47 | reference_wrapper(const reference_wrapper<T>& x) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 48 | |
| 49 | // assignment |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 50 | reference_wrapper& operator=(const reference_wrapper<T>& x) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 51 | |
| 52 | // access |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 53 | operator T& () const noexcept; |
| 54 | T& get() const noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 55 | |
| 56 | // invoke |
| 57 | template <class... ArgTypes> |
Howard Hinnant | c9c775b | 2013-09-21 17:58:58 +0000 | [diff] [blame] | 58 | typename result_of<T&(ArgTypes&&...)>::type |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 59 | operator() (ArgTypes&&...) const; |
| 60 | }; |
| 61 | |
Arthur O'Dwyer | 8fa8794 | 2020-12-05 19:37:41 -0500 | [diff] [blame] | 62 | template <class T> |
| 63 | reference_wrapper(T&) -> reference_wrapper<T>; |
| 64 | |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 65 | template <class T> reference_wrapper<T> ref(T& t) noexcept; |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 66 | template <class T> void ref(const T&& t) = delete; |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 67 | template <class T> reference_wrapper<T> ref(reference_wrapper<T>t) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 68 | |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 69 | template <class T> reference_wrapper<const T> cref(const T& t) noexcept; |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 70 | template <class T> void cref(const T&& t) = delete; |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 71 | template <class T> reference_wrapper<const T> cref(reference_wrapper<T> t) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 72 | |
Louis Dionne | db1892a | 2018-12-03 14:03:27 +0000 | [diff] [blame] | 73 | template <class T> struct unwrap_reference; // since C++20 |
| 74 | template <class T> struct unwrap_ref_decay : unwrap_reference<decay_t<T>> { }; // since C++20 |
| 75 | template <class T> using unwrap_reference_t = typename unwrap_reference<T>::type; // since C++20 |
| 76 | template <class T> using unwrap_ref_decay_t = typename unwrap_ref_decay<T>::type; // since C++20 |
| 77 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 78 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 79 | struct plus { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 80 | T operator()(const T& x, const T& y) const; |
| 81 | }; |
| 82 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 83 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 84 | struct minus { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 85 | T operator()(const T& x, const T& y) const; |
| 86 | }; |
| 87 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 88 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 89 | struct multiplies { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 90 | T operator()(const T& x, const T& y) const; |
| 91 | }; |
| 92 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 93 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 94 | struct divides { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 95 | T operator()(const T& x, const T& y) const; |
| 96 | }; |
| 97 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 98 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 99 | struct modulus { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 100 | T operator()(const T& x, const T& y) const; |
| 101 | }; |
| 102 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 103 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 104 | struct negate { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 105 | T operator()(const T& x) const; |
| 106 | }; |
| 107 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 108 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 109 | struct equal_to { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 110 | bool operator()(const T& x, const T& y) const; |
| 111 | }; |
| 112 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 113 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 114 | struct not_equal_to { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 115 | bool operator()(const T& x, const T& y) const; |
| 116 | }; |
| 117 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 118 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 119 | struct greater { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 120 | bool operator()(const T& x, const T& y) const; |
| 121 | }; |
| 122 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 123 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 124 | struct less { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 125 | bool operator()(const T& x, const T& y) const; |
| 126 | }; |
| 127 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 128 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 129 | struct greater_equal { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 130 | bool operator()(const T& x, const T& y) const; |
| 131 | }; |
| 132 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 133 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 134 | struct less_equal { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 135 | bool operator()(const T& x, const T& y) const; |
| 136 | }; |
| 137 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 138 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 139 | struct logical_and { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 140 | bool operator()(const T& x, const T& y) const; |
| 141 | }; |
| 142 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 143 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 144 | struct logical_or { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 145 | bool operator()(const T& x, const T& y) const; |
| 146 | }; |
| 147 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 148 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 149 | struct logical_not { |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 150 | bool operator()(const T& x) const; |
| 151 | }; |
| 152 | |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 153 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 154 | struct bit_and { |
Arthur O'Dwyer | 0e77445 | 2021-03-07 20:22:03 -0500 | [diff] [blame] | 155 | T operator()(const T& x, const T& y) const; |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 156 | }; |
| 157 | |
| 158 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 159 | struct bit_or { |
Arthur O'Dwyer | 0e77445 | 2021-03-07 20:22:03 -0500 | [diff] [blame] | 160 | T operator()(const T& x, const T& y) const; |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 161 | }; |
| 162 | |
| 163 | template <class T> // <class T=void> in C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 164 | struct bit_xor { |
Arthur O'Dwyer | 0e77445 | 2021-03-07 20:22:03 -0500 | [diff] [blame] | 165 | T operator()(const T& x, const T& y) const; |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 166 | }; |
| 167 | |
| 168 | template <class T=void> // C++14 |
Arthur O'Dwyer | f5486c8 | 2021-05-25 14:34:18 -0400 | [diff] [blame] | 169 | struct bit_not { |
Arthur O'Dwyer | 0e77445 | 2021-03-07 20:22:03 -0500 | [diff] [blame] | 170 | T operator()(const T& x) const; |
Marshall Clow | 974bae2 | 2013-07-29 14:21:53 +0000 | [diff] [blame] | 171 | }; |
| 172 | |
Christopher Di Bella | e68ec58 | 2021-03-18 17:21:35 +0000 | [diff] [blame] | 173 | struct identity; // C++20 |
| 174 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 175 | template <class Predicate> |
Arthur O'Dwyer | a6b5107 | 2021-05-24 18:36:17 -0400 | [diff] [blame] | 176 | class unary_negate // deprecated in C++17, removed in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 177 | : public unary_function<typename Predicate::argument_type, bool> |
| 178 | { |
| 179 | public: |
| 180 | explicit unary_negate(const Predicate& pred); |
| 181 | bool operator()(const typename Predicate::argument_type& x) const; |
| 182 | }; |
| 183 | |
Arthur O'Dwyer | a6b5107 | 2021-05-24 18:36:17 -0400 | [diff] [blame] | 184 | template <class Predicate> // deprecated in C++17, removed in C++20 |
Louis Dionne | 481a266 | 2018-09-23 18:35:00 +0000 | [diff] [blame] | 185 | unary_negate<Predicate> not1(const Predicate& pred); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 186 | |
| 187 | template <class Predicate> |
Arthur O'Dwyer | a6b5107 | 2021-05-24 18:36:17 -0400 | [diff] [blame] | 188 | class binary_negate // deprecated in C++17, removed in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 189 | : public binary_function<typename Predicate::first_argument_type, |
| 190 | typename Predicate::second_argument_type, |
| 191 | bool> |
| 192 | { |
| 193 | public: |
| 194 | explicit binary_negate(const Predicate& pred); |
| 195 | bool operator()(const typename Predicate::first_argument_type& x, |
| 196 | const typename Predicate::second_argument_type& y) const; |
| 197 | }; |
| 198 | |
Arthur O'Dwyer | a6b5107 | 2021-05-24 18:36:17 -0400 | [diff] [blame] | 199 | template <class Predicate> // deprecated in C++17, removed in C++20 |
Louis Dionne | 481a266 | 2018-09-23 18:35:00 +0000 | [diff] [blame] | 200 | binary_negate<Predicate> not2(const Predicate& pred); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 201 | |
Arthur O'Dwyer | 81449d3 | 2020-12-25 14:48:39 -0500 | [diff] [blame] | 202 | template <class F> |
| 203 | constexpr unspecified not_fn(F&& f); // C++17, constexpr in C++20 |
Eric Fiselier | 934f63b | 2016-06-02 01:25:41 +0000 | [diff] [blame] | 204 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 205 | template<class T> struct is_bind_expression; |
| 206 | template<class T> struct is_placeholder; |
| 207 | |
Marshall Clow | 2d2d7f1 | 2016-09-22 00:23:15 +0000 | [diff] [blame] | 208 | // See C++14 20.9.9, Function object binders |
Marshall Clow | f1bf62f | 2018-01-02 17:17:01 +0000 | [diff] [blame] | 209 | template <class T> inline constexpr bool is_bind_expression_v |
Marshall Clow | 2d2d7f1 | 2016-09-22 00:23:15 +0000 | [diff] [blame] | 210 | = is_bind_expression<T>::value; // C++17 |
Marshall Clow | f1bf62f | 2018-01-02 17:17:01 +0000 | [diff] [blame] | 211 | template <class T> inline constexpr int is_placeholder_v |
Marshall Clow | 2d2d7f1 | 2016-09-22 00:23:15 +0000 | [diff] [blame] | 212 | = is_placeholder<T>::value; // C++17 |
| 213 | |
| 214 | |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 215 | template<class Fn, class... BoundArgs> |
Arthur O'Dwyer | 81449d3 | 2020-12-25 14:48:39 -0500 | [diff] [blame] | 216 | constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20 |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 217 | template<class R, class Fn, class... BoundArgs> |
Arthur O'Dwyer | 81449d3 | 2020-12-25 14:48:39 -0500 | [diff] [blame] | 218 | constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 219 | |
Louis Dionne | af34f12 | 2019-04-03 17:54:37 +0000 | [diff] [blame] | 220 | template<class F, class... Args> |
Arthur O'Dwyer | 81449d3 | 2020-12-25 14:48:39 -0500 | [diff] [blame] | 221 | constexpr // constexpr in C++20 |
Louis Dionne | af34f12 | 2019-04-03 17:54:37 +0000 | [diff] [blame] | 222 | invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) // C++17 |
| 223 | noexcept(is_nothrow_invocable_v<F, Args...>); |
| 224 | |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 225 | namespace placeholders { |
| 226 | // M is the implementation-defined number of placeholders |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 227 | extern unspecified _1; |
| 228 | extern unspecified _2; |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 229 | . |
| 230 | . |
| 231 | . |
Howard Hinnant | c834c51 | 2011-11-29 18:15:50 +0000 | [diff] [blame] | 232 | extern unspecified _Mp; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | template <class Operation> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 236 | class binder1st // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 237 | : public unary_function<typename Operation::second_argument_type, |
| 238 | typename Operation::result_type> |
| 239 | { |
| 240 | protected: |
| 241 | Operation op; |
| 242 | typename Operation::first_argument_type value; |
| 243 | public: |
| 244 | binder1st(const Operation& x, const typename Operation::first_argument_type y); |
| 245 | typename Operation::result_type operator()( typename Operation::second_argument_type& x) const; |
| 246 | typename Operation::result_type operator()(const typename Operation::second_argument_type& x) const; |
| 247 | }; |
| 248 | |
| 249 | template <class Operation, class T> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 250 | binder1st<Operation> bind1st(const Operation& op, const T& x); // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 251 | |
| 252 | template <class Operation> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 253 | class binder2nd // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 254 | : public unary_function<typename Operation::first_argument_type, |
| 255 | typename Operation::result_type> |
| 256 | { |
| 257 | protected: |
| 258 | Operation op; |
| 259 | typename Operation::second_argument_type value; |
| 260 | public: |
| 261 | binder2nd(const Operation& x, const typename Operation::second_argument_type y); |
| 262 | typename Operation::result_type operator()( typename Operation::first_argument_type& x) const; |
| 263 | typename Operation::result_type operator()(const typename Operation::first_argument_type& x) const; |
| 264 | }; |
| 265 | |
| 266 | template <class Operation, class T> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 267 | binder2nd<Operation> bind2nd(const Operation& op, const T& x); // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 268 | |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 269 | template <class Arg, class Result> // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 270 | class pointer_to_unary_function : public unary_function<Arg, Result> |
| 271 | { |
| 272 | public: |
| 273 | explicit pointer_to_unary_function(Result (*f)(Arg)); |
| 274 | Result operator()(Arg x) const; |
| 275 | }; |
| 276 | |
| 277 | template <class Arg, class Result> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 278 | pointer_to_unary_function<Arg,Result> ptr_fun(Result (*f)(Arg)); // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 279 | |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 280 | template <class Arg1, class Arg2, class Result> // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 281 | class pointer_to_binary_function : public binary_function<Arg1, Arg2, Result> |
| 282 | { |
| 283 | public: |
| 284 | explicit pointer_to_binary_function(Result (*f)(Arg1, Arg2)); |
| 285 | Result operator()(Arg1 x, Arg2 y) const; |
| 286 | }; |
| 287 | |
| 288 | template <class Arg1, class Arg2, class Result> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 289 | pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1,Arg2)); // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 290 | |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 291 | template<class S, class T> // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 292 | class mem_fun_t : public unary_function<T*, S> |
| 293 | { |
| 294 | public: |
| 295 | explicit mem_fun_t(S (T::*p)()); |
| 296 | S operator()(T* p) const; |
| 297 | }; |
| 298 | |
| 299 | template<class S, class T, class A> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 300 | class mem_fun1_t : public binary_function<T*, A, S> // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 301 | { |
| 302 | public: |
| 303 | explicit mem_fun1_t(S (T::*p)(A)); |
| 304 | S operator()(T* p, A x) const; |
| 305 | }; |
| 306 | |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 307 | template<class S, class T> mem_fun_t<S,T> mem_fun(S (T::*f)()); // deprecated in C++11, removed in C++17 |
| 308 | template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A)); // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 309 | |
| 310 | template<class S, class T> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 311 | class mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 312 | { |
| 313 | public: |
| 314 | explicit mem_fun_ref_t(S (T::*p)()); |
| 315 | S operator()(T& p) const; |
| 316 | }; |
| 317 | |
| 318 | template<class S, class T, class A> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 319 | class mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 320 | { |
| 321 | public: |
| 322 | explicit mem_fun1_ref_t(S (T::*p)(A)); |
| 323 | S operator()(T& p, A x) const; |
| 324 | }; |
| 325 | |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 326 | template<class S, class T> mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()); // deprecated in C++11, removed in C++17 |
| 327 | template<class S, class T, class A> mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A)); // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 328 | |
| 329 | template <class S, class T> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 330 | class const_mem_fun_t : public unary_function<const T*, S> // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 331 | { |
| 332 | public: |
| 333 | explicit const_mem_fun_t(S (T::*p)() const); |
| 334 | S operator()(const T* p) const; |
| 335 | }; |
| 336 | |
| 337 | template <class S, class T, class A> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 338 | class const_mem_fun1_t : public binary_function<const T*, A, S> // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 339 | { |
| 340 | public: |
| 341 | explicit const_mem_fun1_t(S (T::*p)(A) const); |
| 342 | S operator()(const T* p, A x) const; |
| 343 | }; |
| 344 | |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 345 | template <class S, class T> const_mem_fun_t<S,T> mem_fun(S (T::*f)() const); // deprecated in C++11, removed in C++17 |
| 346 | template <class S, class T, class A> const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const); // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 347 | |
| 348 | template <class S, class T> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 349 | class const_mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 350 | { |
| 351 | public: |
| 352 | explicit const_mem_fun_ref_t(S (T::*p)() const); |
| 353 | S operator()(const T& p) const; |
| 354 | }; |
| 355 | |
| 356 | template <class S, class T, class A> |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 357 | class const_mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 358 | { |
| 359 | public: |
| 360 | explicit const_mem_fun1_ref_t(S (T::*p)(A) const); |
| 361 | S operator()(const T& p, A x) const; |
| 362 | }; |
| 363 | |
Marshall Clow | 26a027c | 2017-04-13 18:25:32 +0000 | [diff] [blame] | 364 | template <class S, class T> const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17 |
| 365 | template <class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 366 | |
Arthur O'Dwyer | 81449d3 | 2020-12-25 14:48:39 -0500 | [diff] [blame] | 367 | template<class R, class T> |
| 368 | constexpr unspecified mem_fn(R T::*); // constexpr in C++20 |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 369 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 370 | class bad_function_call |
| 371 | : public exception |
| 372 | { |
| 373 | }; |
| 374 | |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 375 | template<class> class function; // undefined |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 376 | |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 377 | template<class R, class... ArgTypes> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 378 | class function<R(ArgTypes...)> |
| 379 | : public unary_function<T1, R> // iff sizeof...(ArgTypes) == 1 and |
| 380 | // ArgTypes contains T1 |
| 381 | : public binary_function<T1, T2, R> // iff sizeof...(ArgTypes) == 2 and |
| 382 | // ArgTypes contains T1 and T2 |
| 383 | { |
| 384 | public: |
| 385 | typedef R result_type; |
| 386 | |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 387 | // construct/copy/destroy: |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 388 | function() noexcept; |
| 389 | function(nullptr_t) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 390 | function(const function&); |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 391 | function(function&&) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 392 | template<class F> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 393 | function(F); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 394 | template<Allocator Alloc> |
Marshall Clow | 3148f42 | 2016-10-13 21:06:03 +0000 | [diff] [blame] | 395 | function(allocator_arg_t, const Alloc&) noexcept; // removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 396 | template<Allocator Alloc> |
Marshall Clow | 3148f42 | 2016-10-13 21:06:03 +0000 | [diff] [blame] | 397 | function(allocator_arg_t, const Alloc&, nullptr_t) noexcept; // removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 398 | template<Allocator Alloc> |
Marshall Clow | 3148f42 | 2016-10-13 21:06:03 +0000 | [diff] [blame] | 399 | function(allocator_arg_t, const Alloc&, const function&); // removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 400 | template<Allocator Alloc> |
Marshall Clow | 3148f42 | 2016-10-13 21:06:03 +0000 | [diff] [blame] | 401 | function(allocator_arg_t, const Alloc&, function&&); // removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 402 | template<class F, Allocator Alloc> |
Marshall Clow | 3148f42 | 2016-10-13 21:06:03 +0000 | [diff] [blame] | 403 | function(allocator_arg_t, const Alloc&, F); // removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 404 | |
| 405 | function& operator=(const function&); |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 406 | function& operator=(function&&) noexcept; |
Howard Hinnant | 7b85be0 | 2011-05-29 13:53:56 +0000 | [diff] [blame] | 407 | function& operator=(nullptr_t) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 408 | template<class F> |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 409 | function& operator=(F&&); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 410 | template<class F> |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 411 | function& operator=(reference_wrapper<F>) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 412 | |
| 413 | ~function(); |
| 414 | |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 415 | // function modifiers: |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 416 | void swap(function&) noexcept; |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 417 | template<class F, class Alloc> |
Marshall Clow | fc8fd83 | 2016-01-25 17:29:55 +0000 | [diff] [blame] | 418 | void assign(F&&, const Alloc&); // Removed in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 419 | |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 420 | // function capacity: |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 421 | explicit operator bool() const noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 422 | |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 423 | // function invocation: |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 424 | R operator()(ArgTypes...) const; |
| 425 | |
Howard Hinnant | f06d926 | 2010-08-20 19:36:46 +0000 | [diff] [blame] | 426 | // function target access: |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 427 | const std::type_info& target_type() const noexcept; |
| 428 | template <typename T> T* target() noexcept; |
| 429 | template <typename T> const T* target() const noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 430 | }; |
| 431 | |
Louis Dionne | 4af4971 | 2019-07-18 19:50:56 +0000 | [diff] [blame] | 432 | // Deduction guides |
| 433 | template<class R, class ...Args> |
| 434 | function(R(*)(Args...)) -> function<R(Args...)>; // since C++17 |
| 435 | |
| 436 | template<class F> |
| 437 | function(F) -> function<see-below>; // since C++17 |
| 438 | |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 439 | // Null pointer comparisons: |
| 440 | template <class R, class ... ArgTypes> |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 441 | bool operator==(const function<R(ArgTypes...)>&, nullptr_t) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 442 | |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 443 | template <class R, class ... ArgTypes> |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 444 | bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 445 | |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 446 | template <class R, class ... ArgTypes> |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 447 | bool operator!=(const function<R(ArgTypes...)>&, nullptr_t) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 448 | |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 449 | template <class R, class ... ArgTypes> |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 450 | bool operator!=(nullptr_t, const function<R(ArgTypes...)>&) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 451 | |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 452 | // specialized algorithms: |
| 453 | template <class R, class ... ArgTypes> |
Howard Hinnant | f7724cd | 2011-05-28 17:59:48 +0000 | [diff] [blame] | 454 | void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 455 | |
| 456 | template <class T> struct hash; |
| 457 | |
| 458 | template <> struct hash<bool>; |
| 459 | template <> struct hash<char>; |
| 460 | template <> struct hash<signed char>; |
| 461 | template <> struct hash<unsigned char>; |
Yuriy Chernyshov | fbb87fa | 2020-12-08 13:39:56 -0500 | [diff] [blame] | 462 | template <> struct hash<char8_t>; // since C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 463 | template <> struct hash<char16_t>; |
| 464 | template <> struct hash<char32_t>; |
| 465 | template <> struct hash<wchar_t>; |
| 466 | template <> struct hash<short>; |
| 467 | template <> struct hash<unsigned short>; |
| 468 | template <> struct hash<int>; |
| 469 | template <> struct hash<unsigned int>; |
| 470 | template <> struct hash<long>; |
| 471 | template <> struct hash<long long>; |
| 472 | template <> struct hash<unsigned long>; |
| 473 | template <> struct hash<unsigned long long>; |
| 474 | |
| 475 | template <> struct hash<float>; |
| 476 | template <> struct hash<double>; |
| 477 | template <> struct hash<long double>; |
| 478 | |
| 479 | template<class T> struct hash<T*>; |
Marshall Clow | cc25222 | 2017-03-23 06:20:18 +0000 | [diff] [blame] | 480 | template <> struct hash<nullptr_t>; // C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 481 | |
| 482 | } // std |
| 483 | |
| 484 | POLICY: For non-variadic implementations, the number of arguments is limited |
| 485 | to 3. It is hoped that the need for non-variadic implementations |
| 486 | will be minimal. |
| 487 | |
| 488 | */ |
| 489 | |
Louis Dionne | b1791ce | 2021-06-29 11:33:16 -0400 | [diff] [blame] | 490 | #include <__algorithm/search.h> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 491 | #include <__config> |
Arthur O'Dwyer | 597cac4 | 2021-05-12 23:04:03 -0400 | [diff] [blame] | 492 | #include <__debug> |
Christopher Di Bella | 55d7a82 | 2021-07-01 09:25:35 -0400 | [diff] [blame] | 493 | #include <__functional/binary_function.h> // TODO: deprecate |
| 494 | #include <__functional/binary_negate.h> |
Louis Dionne | 067e22b | 2021-08-09 15:41:26 -0400 | [diff] [blame^] | 495 | #include <__functional/bind_back.h> |
Christopher Di Bella | 55d7a82 | 2021-07-01 09:25:35 -0400 | [diff] [blame] | 496 | #include <__functional/bind_front.h> |
| 497 | #include <__functional/bind.h> |
| 498 | #include <__functional/binder1st.h> |
| 499 | #include <__functional/binder2nd.h> |
Louis Dionne | 067e22b | 2021-08-09 15:41:26 -0400 | [diff] [blame^] | 500 | #include <__functional/compose.h> |
Christopher Di Bella | 55d7a82 | 2021-07-01 09:25:35 -0400 | [diff] [blame] | 501 | #include <__functional/default_searcher.h> |
| 502 | #include <__functional/function.h> |
Christopher Di Bella | 599a6c6 | 2021-06-09 23:10:17 +0000 | [diff] [blame] | 503 | #include <__functional/hash.h> |
Christopher Di Bella | 55d7a82 | 2021-07-01 09:25:35 -0400 | [diff] [blame] | 504 | #include <__functional/identity.h> |
| 505 | #include <__functional/invoke.h> |
| 506 | #include <__functional/mem_fn.h> // TODO: deprecate |
| 507 | #include <__functional/mem_fun_ref.h> |
| 508 | #include <__functional/not_fn.h> |
| 509 | #include <__functional/operations.h> |
| 510 | #include <__functional/pointer_to_binary_function.h> |
| 511 | #include <__functional/pointer_to_unary_function.h> |
| 512 | #include <__functional/ranges_operations.h> |
| 513 | #include <__functional/reference_wrapper.h> |
| 514 | #include <__functional/unary_function.h> // TODO: deprecate |
| 515 | #include <__functional/unary_negate.h> |
Christopher Di Bella | 599a6c6 | 2021-06-09 23:10:17 +0000 | [diff] [blame] | 516 | #include <__functional/unwrap_ref.h> |
Christopher Di Bella | 41f26e8 | 2021-06-05 02:47:47 +0000 | [diff] [blame] | 517 | #include <__utility/forward.h> |
zoecarver | 9ce102c | 2021-04-22 17:33:04 -0700 | [diff] [blame] | 518 | #include <concepts> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 519 | #include <exception> |
| 520 | #include <memory> |
| 521 | #include <tuple> |
Arthur O'Dwyer | ef18160 | 2021-05-19 11:57:04 -0400 | [diff] [blame] | 522 | #include <type_traits> |
| 523 | #include <typeinfo> |
Eric Fiselier | 698a97b | 2017-01-21 00:02:12 +0000 | [diff] [blame] | 524 | #include <utility> |
Marshall Clow | 0a1e750 | 2018-09-12 19:41:40 +0000 | [diff] [blame] | 525 | #include <version> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 526 | |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 527 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 528 | #pragma GCC system_header |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 529 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 530 | |
Louis Dionne | 2b1ceaa | 2021-04-20 12:03:32 -0400 | [diff] [blame] | 531 | #endif // _LIBCPP_FUNCTIONAL |