2 //===----------------------------------------------------------------------===//
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
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___FUNCTIONAL_OPERATIONS_H
11 #define _LIBCPP___FUNCTIONAL_OPERATIONS_H
14 #include <__functional/binary_function.h>
15 #include <__functional/unary_function.h>
16 #include <__utility/forward.h>
18 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19 #pragma GCC system_header
22 _LIBCPP_BEGIN_NAMESPACE_STD
24 // Arithmetic operations
26 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
27 #if _LIBCPP_STD_VER > 11
28 template <class _Tp
= void>
32 struct _LIBCPP_TEMPLATE_VIS plus
33 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
34 : binary_function
<_Tp
, _Tp
, _Tp
>
37 _LIBCPP_SUPPRESS_DEPRECATED_POP
38 typedef _Tp __result_type
; // used by valarray
39 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
40 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp result_type
;
41 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
42 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
44 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
45 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
49 #if _LIBCPP_STD_VER > 11
51 struct _LIBCPP_TEMPLATE_VIS plus
<void>
53 template <class _T1
, class _T2
>
54 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
55 auto operator()(_T1
&& __t
, _T2
&& __u
) const
56 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) + _VSTD::forward
<_T2
>(__u
)))
57 -> decltype( _VSTD::forward
<_T1
>(__t
) + _VSTD::forward
<_T2
>(__u
))
58 { return _VSTD::forward
<_T1
>(__t
) + _VSTD::forward
<_T2
>(__u
); }
59 typedef void is_transparent
;
63 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
64 #if _LIBCPP_STD_VER > 11
65 template <class _Tp
= void>
69 struct _LIBCPP_TEMPLATE_VIS minus
70 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
71 : binary_function
<_Tp
, _Tp
, _Tp
>
74 _LIBCPP_SUPPRESS_DEPRECATED_POP
75 typedef _Tp __result_type
; // used by valarray
76 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
77 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp result_type
;
78 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
79 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
81 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
82 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
86 #if _LIBCPP_STD_VER > 11
88 struct _LIBCPP_TEMPLATE_VIS minus
<void>
90 template <class _T1
, class _T2
>
91 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
92 auto operator()(_T1
&& __t
, _T2
&& __u
) const
93 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) - _VSTD::forward
<_T2
>(__u
)))
94 -> decltype( _VSTD::forward
<_T1
>(__t
) - _VSTD::forward
<_T2
>(__u
))
95 { return _VSTD::forward
<_T1
>(__t
) - _VSTD::forward
<_T2
>(__u
); }
96 typedef void is_transparent
;
100 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
101 #if _LIBCPP_STD_VER > 11
102 template <class _Tp
= void>
106 struct _LIBCPP_TEMPLATE_VIS multiplies
107 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
108 : binary_function
<_Tp
, _Tp
, _Tp
>
111 _LIBCPP_SUPPRESS_DEPRECATED_POP
112 typedef _Tp __result_type
; // used by valarray
113 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
114 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp result_type
;
115 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
116 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
118 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
119 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
123 #if _LIBCPP_STD_VER > 11
125 struct _LIBCPP_TEMPLATE_VIS multiplies
<void>
127 template <class _T1
, class _T2
>
128 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
129 auto operator()(_T1
&& __t
, _T2
&& __u
) const
130 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) * _VSTD::forward
<_T2
>(__u
)))
131 -> decltype( _VSTD::forward
<_T1
>(__t
) * _VSTD::forward
<_T2
>(__u
))
132 { return _VSTD::forward
<_T1
>(__t
) * _VSTD::forward
<_T2
>(__u
); }
133 typedef void is_transparent
;
137 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
138 #if _LIBCPP_STD_VER > 11
139 template <class _Tp
= void>
143 struct _LIBCPP_TEMPLATE_VIS divides
144 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
145 : binary_function
<_Tp
, _Tp
, _Tp
>
148 _LIBCPP_SUPPRESS_DEPRECATED_POP
149 typedef _Tp __result_type
; // used by valarray
150 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
151 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp result_type
;
152 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
153 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
155 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
156 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
160 #if _LIBCPP_STD_VER > 11
162 struct _LIBCPP_TEMPLATE_VIS divides
<void>
164 template <class _T1
, class _T2
>
165 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
166 auto operator()(_T1
&& __t
, _T2
&& __u
) const
167 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) / _VSTD::forward
<_T2
>(__u
)))
168 -> decltype( _VSTD::forward
<_T1
>(__t
) / _VSTD::forward
<_T2
>(__u
))
169 { return _VSTD::forward
<_T1
>(__t
) / _VSTD::forward
<_T2
>(__u
); }
170 typedef void is_transparent
;
174 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
175 #if _LIBCPP_STD_VER > 11
176 template <class _Tp
= void>
180 struct _LIBCPP_TEMPLATE_VIS modulus
181 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
182 : binary_function
<_Tp
, _Tp
, _Tp
>
185 _LIBCPP_SUPPRESS_DEPRECATED_POP
186 typedef _Tp __result_type
; // used by valarray
187 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
188 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp result_type
;
189 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
190 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
192 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
193 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
197 #if _LIBCPP_STD_VER > 11
199 struct _LIBCPP_TEMPLATE_VIS modulus
<void>
201 template <class _T1
, class _T2
>
202 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
203 auto operator()(_T1
&& __t
, _T2
&& __u
) const
204 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) % _VSTD::forward
<_T2
>(__u
)))
205 -> decltype( _VSTD::forward
<_T1
>(__t
) % _VSTD::forward
<_T2
>(__u
))
206 { return _VSTD::forward
<_T1
>(__t
) % _VSTD::forward
<_T2
>(__u
); }
207 typedef void is_transparent
;
211 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
212 #if _LIBCPP_STD_VER > 11
213 template <class _Tp
= void>
217 struct _LIBCPP_TEMPLATE_VIS negate
218 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
219 : unary_function
<_Tp
, _Tp
>
222 _LIBCPP_SUPPRESS_DEPRECATED_POP
223 typedef _Tp __result_type
; // used by valarray
224 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
225 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp result_type
;
226 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp argument_type
;
228 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
229 _Tp
operator()(const _Tp
& __x
) const
233 #if _LIBCPP_STD_VER > 11
235 struct _LIBCPP_TEMPLATE_VIS negate
<void>
238 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
239 auto operator()(_Tp
&& __x
) const
240 noexcept(noexcept(- _VSTD::forward
<_Tp
>(__x
)))
241 -> decltype( - _VSTD::forward
<_Tp
>(__x
))
242 { return - _VSTD::forward
<_Tp
>(__x
); }
243 typedef void is_transparent
;
247 // Bitwise operations
249 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
250 #if _LIBCPP_STD_VER > 11
251 template <class _Tp
= void>
255 struct _LIBCPP_TEMPLATE_VIS bit_and
256 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
257 : binary_function
<_Tp
, _Tp
, _Tp
>
260 _LIBCPP_SUPPRESS_DEPRECATED_POP
261 typedef _Tp __result_type
; // used by valarray
262 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
263 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp result_type
;
264 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
265 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
267 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
268 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
272 #if _LIBCPP_STD_VER > 11
274 struct _LIBCPP_TEMPLATE_VIS bit_and
<void>
276 template <class _T1
, class _T2
>
277 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
278 auto operator()(_T1
&& __t
, _T2
&& __u
) const
279 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) & _VSTD::forward
<_T2
>(__u
)))
280 -> decltype( _VSTD::forward
<_T1
>(__t
) & _VSTD::forward
<_T2
>(__u
))
281 { return _VSTD::forward
<_T1
>(__t
) & _VSTD::forward
<_T2
>(__u
); }
282 typedef void is_transparent
;
286 #if _LIBCPP_STD_VER > 11
287 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
288 template <class _Tp
= void>
289 struct _LIBCPP_TEMPLATE_VIS bit_not
290 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
291 : unary_function
<_Tp
, _Tp
>
294 _LIBCPP_SUPPRESS_DEPRECATED_POP
295 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
296 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp result_type
;
297 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp argument_type
;
299 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
300 _Tp
operator()(const _Tp
& __x
) const
305 struct _LIBCPP_TEMPLATE_VIS bit_not
<void>
308 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
309 auto operator()(_Tp
&& __x
) const
310 noexcept(noexcept(~_VSTD::forward
<_Tp
>(__x
)))
311 -> decltype( ~_VSTD::forward
<_Tp
>(__x
))
312 { return ~_VSTD::forward
<_Tp
>(__x
); }
313 typedef void is_transparent
;
317 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
318 #if _LIBCPP_STD_VER > 11
319 template <class _Tp
= void>
323 struct _LIBCPP_TEMPLATE_VIS bit_or
324 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
325 : binary_function
<_Tp
, _Tp
, _Tp
>
328 _LIBCPP_SUPPRESS_DEPRECATED_POP
329 typedef _Tp __result_type
; // used by valarray
330 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
331 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp result_type
;
332 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
333 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
335 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
336 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
340 #if _LIBCPP_STD_VER > 11
342 struct _LIBCPP_TEMPLATE_VIS bit_or
<void>
344 template <class _T1
, class _T2
>
345 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
346 auto operator()(_T1
&& __t
, _T2
&& __u
) const
347 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) | _VSTD::forward
<_T2
>(__u
)))
348 -> decltype( _VSTD::forward
<_T1
>(__t
) | _VSTD::forward
<_T2
>(__u
))
349 { return _VSTD::forward
<_T1
>(__t
) | _VSTD::forward
<_T2
>(__u
); }
350 typedef void is_transparent
;
354 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
355 #if _LIBCPP_STD_VER > 11
356 template <class _Tp
= void>
360 struct _LIBCPP_TEMPLATE_VIS bit_xor
361 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
362 : binary_function
<_Tp
, _Tp
, _Tp
>
365 _LIBCPP_SUPPRESS_DEPRECATED_POP
366 typedef _Tp __result_type
; // used by valarray
367 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
368 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp result_type
;
369 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
370 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
372 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
373 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
377 #if _LIBCPP_STD_VER > 11
379 struct _LIBCPP_TEMPLATE_VIS bit_xor
<void>
381 template <class _T1
, class _T2
>
382 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
383 auto operator()(_T1
&& __t
, _T2
&& __u
) const
384 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) ^ _VSTD::forward
<_T2
>(__u
)))
385 -> decltype( _VSTD::forward
<_T1
>(__t
) ^ _VSTD::forward
<_T2
>(__u
))
386 { return _VSTD::forward
<_T1
>(__t
) ^ _VSTD::forward
<_T2
>(__u
); }
387 typedef void is_transparent
;
391 // Comparison operations
393 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
394 #if _LIBCPP_STD_VER > 11
395 template <class _Tp
= void>
399 struct _LIBCPP_TEMPLATE_VIS equal_to
400 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
401 : binary_function
<_Tp
, _Tp
, bool>
404 _LIBCPP_SUPPRESS_DEPRECATED_POP
405 typedef bool __result_type
; // used by valarray
406 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
407 _LIBCPP_DEPRECATED_IN_CXX17
typedef bool result_type
;
408 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
409 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
411 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
412 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
416 #if _LIBCPP_STD_VER > 11
418 struct _LIBCPP_TEMPLATE_VIS equal_to
<void>
420 template <class _T1
, class _T2
>
421 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
422 auto operator()(_T1
&& __t
, _T2
&& __u
) const
423 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) == _VSTD::forward
<_T2
>(__u
)))
424 -> decltype( _VSTD::forward
<_T1
>(__t
) == _VSTD::forward
<_T2
>(__u
))
425 { return _VSTD::forward
<_T1
>(__t
) == _VSTD::forward
<_T2
>(__u
); }
426 typedef void is_transparent
;
430 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
431 #if _LIBCPP_STD_VER > 11
432 template <class _Tp
= void>
436 struct _LIBCPP_TEMPLATE_VIS not_equal_to
437 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
438 : binary_function
<_Tp
, _Tp
, bool>
441 _LIBCPP_SUPPRESS_DEPRECATED_POP
442 typedef bool __result_type
; // used by valarray
443 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
444 _LIBCPP_DEPRECATED_IN_CXX17
typedef bool result_type
;
445 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
446 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
448 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
449 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
453 #if _LIBCPP_STD_VER > 11
455 struct _LIBCPP_TEMPLATE_VIS not_equal_to
<void>
457 template <class _T1
, class _T2
>
458 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
459 auto operator()(_T1
&& __t
, _T2
&& __u
) const
460 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) != _VSTD::forward
<_T2
>(__u
)))
461 -> decltype( _VSTD::forward
<_T1
>(__t
) != _VSTD::forward
<_T2
>(__u
))
462 { return _VSTD::forward
<_T1
>(__t
) != _VSTD::forward
<_T2
>(__u
); }
463 typedef void is_transparent
;
467 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
468 #if _LIBCPP_STD_VER > 11
469 template <class _Tp
= void>
473 struct _LIBCPP_TEMPLATE_VIS less
474 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
475 : binary_function
<_Tp
, _Tp
, bool>
478 _LIBCPP_SUPPRESS_DEPRECATED_POP
479 typedef bool __result_type
; // used by valarray
480 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
481 _LIBCPP_DEPRECATED_IN_CXX17
typedef bool result_type
;
482 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
483 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
485 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
486 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
490 #if _LIBCPP_STD_VER > 11
492 struct _LIBCPP_TEMPLATE_VIS less
<void>
494 template <class _T1
, class _T2
>
495 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
496 auto operator()(_T1
&& __t
, _T2
&& __u
) const
497 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) < _VSTD::forward
<_T2
>(__u
)))
498 -> decltype( _VSTD::forward
<_T1
>(__t
) < _VSTD::forward
<_T2
>(__u
))
499 { return _VSTD::forward
<_T1
>(__t
) < _VSTD::forward
<_T2
>(__u
); }
500 typedef void is_transparent
;
504 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
505 #if _LIBCPP_STD_VER > 11
506 template <class _Tp
= void>
510 struct _LIBCPP_TEMPLATE_VIS less_equal
511 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
512 : binary_function
<_Tp
, _Tp
, bool>
515 _LIBCPP_SUPPRESS_DEPRECATED_POP
516 typedef bool __result_type
; // used by valarray
517 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
518 _LIBCPP_DEPRECATED_IN_CXX17
typedef bool result_type
;
519 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
520 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
522 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
523 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
527 #if _LIBCPP_STD_VER > 11
529 struct _LIBCPP_TEMPLATE_VIS less_equal
<void>
531 template <class _T1
, class _T2
>
532 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
533 auto operator()(_T1
&& __t
, _T2
&& __u
) const
534 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) <= _VSTD::forward
<_T2
>(__u
)))
535 -> decltype( _VSTD::forward
<_T1
>(__t
) <= _VSTD::forward
<_T2
>(__u
))
536 { return _VSTD::forward
<_T1
>(__t
) <= _VSTD::forward
<_T2
>(__u
); }
537 typedef void is_transparent
;
541 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
542 #if _LIBCPP_STD_VER > 11
543 template <class _Tp
= void>
547 struct _LIBCPP_TEMPLATE_VIS greater_equal
548 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
549 : binary_function
<_Tp
, _Tp
, bool>
552 _LIBCPP_SUPPRESS_DEPRECATED_POP
553 typedef bool __result_type
; // used by valarray
554 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
555 _LIBCPP_DEPRECATED_IN_CXX17
typedef bool result_type
;
556 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
557 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
559 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
560 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
564 #if _LIBCPP_STD_VER > 11
566 struct _LIBCPP_TEMPLATE_VIS greater_equal
<void>
568 template <class _T1
, class _T2
>
569 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
570 auto operator()(_T1
&& __t
, _T2
&& __u
) const
571 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) >= _VSTD::forward
<_T2
>(__u
)))
572 -> decltype( _VSTD::forward
<_T1
>(__t
) >= _VSTD::forward
<_T2
>(__u
))
573 { return _VSTD::forward
<_T1
>(__t
) >= _VSTD::forward
<_T2
>(__u
); }
574 typedef void is_transparent
;
578 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
579 #if _LIBCPP_STD_VER > 11
580 template <class _Tp
= void>
584 struct _LIBCPP_TEMPLATE_VIS greater
585 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
586 : binary_function
<_Tp
, _Tp
, bool>
589 _LIBCPP_SUPPRESS_DEPRECATED_POP
590 typedef bool __result_type
; // used by valarray
591 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
592 _LIBCPP_DEPRECATED_IN_CXX17
typedef bool result_type
;
593 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
594 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
596 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
597 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
601 #if _LIBCPP_STD_VER > 11
603 struct _LIBCPP_TEMPLATE_VIS greater
<void>
605 template <class _T1
, class _T2
>
606 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
607 auto operator()(_T1
&& __t
, _T2
&& __u
) const
608 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) > _VSTD::forward
<_T2
>(__u
)))
609 -> decltype( _VSTD::forward
<_T1
>(__t
) > _VSTD::forward
<_T2
>(__u
))
610 { return _VSTD::forward
<_T1
>(__t
) > _VSTD::forward
<_T2
>(__u
); }
611 typedef void is_transparent
;
615 // Logical operations
617 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
618 #if _LIBCPP_STD_VER > 11
619 template <class _Tp
= void>
623 struct _LIBCPP_TEMPLATE_VIS logical_and
624 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
625 : binary_function
<_Tp
, _Tp
, bool>
628 _LIBCPP_SUPPRESS_DEPRECATED_POP
629 typedef bool __result_type
; // used by valarray
630 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
631 _LIBCPP_DEPRECATED_IN_CXX17
typedef bool result_type
;
632 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
633 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
635 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
636 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
640 #if _LIBCPP_STD_VER > 11
642 struct _LIBCPP_TEMPLATE_VIS logical_and
<void>
644 template <class _T1
, class _T2
>
645 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
646 auto operator()(_T1
&& __t
, _T2
&& __u
) const
647 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) && _VSTD::forward
<_T2
>(__u
)))
648 -> decltype( _VSTD::forward
<_T1
>(__t
) && _VSTD::forward
<_T2
>(__u
))
649 { return _VSTD::forward
<_T1
>(__t
) && _VSTD::forward
<_T2
>(__u
); }
650 typedef void is_transparent
;
654 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
655 #if _LIBCPP_STD_VER > 11
656 template <class _Tp
= void>
660 struct _LIBCPP_TEMPLATE_VIS logical_not
661 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
662 : unary_function
<_Tp
, bool>
665 _LIBCPP_SUPPRESS_DEPRECATED_POP
666 typedef bool __result_type
; // used by valarray
667 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
668 _LIBCPP_DEPRECATED_IN_CXX17
typedef bool result_type
;
669 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp argument_type
;
671 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
672 bool operator()(const _Tp
& __x
) const
676 #if _LIBCPP_STD_VER > 11
678 struct _LIBCPP_TEMPLATE_VIS logical_not
<void>
681 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
682 auto operator()(_Tp
&& __x
) const
683 noexcept(noexcept(!_VSTD::forward
<_Tp
>(__x
)))
684 -> decltype( !_VSTD::forward
<_Tp
>(__x
))
685 { return !_VSTD::forward
<_Tp
>(__x
); }
686 typedef void is_transparent
;
690 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
691 #if _LIBCPP_STD_VER > 11
692 template <class _Tp
= void>
696 struct _LIBCPP_TEMPLATE_VIS logical_or
697 #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
698 : binary_function
<_Tp
, _Tp
, bool>
701 _LIBCPP_SUPPRESS_DEPRECATED_POP
702 typedef bool __result_type
; // used by valarray
703 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
704 _LIBCPP_DEPRECATED_IN_CXX17
typedef bool result_type
;
705 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp first_argument_type
;
706 _LIBCPP_DEPRECATED_IN_CXX17
typedef _Tp second_argument_type
;
708 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
709 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
713 #if _LIBCPP_STD_VER > 11
715 struct _LIBCPP_TEMPLATE_VIS logical_or
<void>
717 template <class _T1
, class _T2
>
718 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
719 auto operator()(_T1
&& __t
, _T2
&& __u
) const
720 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) || _VSTD::forward
<_T2
>(__u
)))
721 -> decltype( _VSTD::forward
<_T1
>(__t
) || _VSTD::forward
<_T2
>(__u
))
722 { return _VSTD::forward
<_T1
>(__t
) || _VSTD::forward
<_T2
>(__u
); }
723 typedef void is_transparent
;
727 _LIBCPP_END_NAMESPACE_STD
729 #endif // _LIBCPP___FUNCTIONAL_OPERATIONS_H