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 <__type_traits/integral_constant.h>
17 #include <__type_traits/operation_traits.h>
18 #include <__type_traits/predicate_traits.h>
19 #include <__utility/forward.h>
21 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
22 # pragma GCC system_header
25 _LIBCPP_BEGIN_NAMESPACE_STD
27 // Arithmetic operations
29 #if _LIBCPP_STD_VER >= 14
30 template <class _Tp
= void>
34 struct _LIBCPP_TEMPLATE_VIS plus
35 : __binary_function
<_Tp
, _Tp
, _Tp
>
37 typedef _Tp __result_type
; // used by valarray
38 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
39 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
42 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(plus
);
45 struct __is_trivial_plus_operation
<plus
<_Tp
>, _Tp
, _Tp
> : true_type
{};
47 #if _LIBCPP_STD_VER >= 14
48 template <class _Tp
, class _Up
>
49 struct __is_trivial_plus_operation
<plus
<>, _Tp
, _Up
> : true_type
{};
52 #if _LIBCPP_STD_VER >= 14
54 struct _LIBCPP_TEMPLATE_VIS plus
<void>
56 template <class _T1
, class _T2
>
57 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
58 auto operator()(_T1
&& __t
, _T2
&& __u
) const
59 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) + _VSTD::forward
<_T2
>(__u
)))
60 -> decltype( _VSTD::forward
<_T1
>(__t
) + _VSTD::forward
<_T2
>(__u
))
61 { return _VSTD::forward
<_T1
>(__t
) + _VSTD::forward
<_T2
>(__u
); }
62 typedef void is_transparent
;
66 #if _LIBCPP_STD_VER >= 14
67 template <class _Tp
= void>
71 struct _LIBCPP_TEMPLATE_VIS minus
72 : __binary_function
<_Tp
, _Tp
, _Tp
>
74 typedef _Tp __result_type
; // used by valarray
75 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
76 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
79 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(minus
);
81 #if _LIBCPP_STD_VER >= 14
83 struct _LIBCPP_TEMPLATE_VIS minus
<void>
85 template <class _T1
, class _T2
>
86 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
87 auto operator()(_T1
&& __t
, _T2
&& __u
) const
88 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) - _VSTD::forward
<_T2
>(__u
)))
89 -> decltype( _VSTD::forward
<_T1
>(__t
) - _VSTD::forward
<_T2
>(__u
))
90 { return _VSTD::forward
<_T1
>(__t
) - _VSTD::forward
<_T2
>(__u
); }
91 typedef void is_transparent
;
95 #if _LIBCPP_STD_VER >= 14
96 template <class _Tp
= void>
100 struct _LIBCPP_TEMPLATE_VIS multiplies
101 : __binary_function
<_Tp
, _Tp
, _Tp
>
103 typedef _Tp __result_type
; // used by valarray
104 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
105 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
108 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(multiplies
);
110 #if _LIBCPP_STD_VER >= 14
112 struct _LIBCPP_TEMPLATE_VIS multiplies
<void>
114 template <class _T1
, class _T2
>
115 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
116 auto operator()(_T1
&& __t
, _T2
&& __u
) const
117 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) * _VSTD::forward
<_T2
>(__u
)))
118 -> decltype( _VSTD::forward
<_T1
>(__t
) * _VSTD::forward
<_T2
>(__u
))
119 { return _VSTD::forward
<_T1
>(__t
) * _VSTD::forward
<_T2
>(__u
); }
120 typedef void is_transparent
;
124 #if _LIBCPP_STD_VER >= 14
125 template <class _Tp
= void>
129 struct _LIBCPP_TEMPLATE_VIS divides
130 : __binary_function
<_Tp
, _Tp
, _Tp
>
132 typedef _Tp __result_type
; // used by valarray
133 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
134 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
137 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(divides
);
139 #if _LIBCPP_STD_VER >= 14
141 struct _LIBCPP_TEMPLATE_VIS divides
<void>
143 template <class _T1
, class _T2
>
144 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
145 auto operator()(_T1
&& __t
, _T2
&& __u
) const
146 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) / _VSTD::forward
<_T2
>(__u
)))
147 -> decltype( _VSTD::forward
<_T1
>(__t
) / _VSTD::forward
<_T2
>(__u
))
148 { return _VSTD::forward
<_T1
>(__t
) / _VSTD::forward
<_T2
>(__u
); }
149 typedef void is_transparent
;
153 #if _LIBCPP_STD_VER >= 14
154 template <class _Tp
= void>
158 struct _LIBCPP_TEMPLATE_VIS modulus
159 : __binary_function
<_Tp
, _Tp
, _Tp
>
161 typedef _Tp __result_type
; // used by valarray
162 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
163 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
166 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(modulus
);
168 #if _LIBCPP_STD_VER >= 14
170 struct _LIBCPP_TEMPLATE_VIS modulus
<void>
172 template <class _T1
, class _T2
>
173 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
174 auto operator()(_T1
&& __t
, _T2
&& __u
) const
175 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) % _VSTD::forward
<_T2
>(__u
)))
176 -> decltype( _VSTD::forward
<_T1
>(__t
) % _VSTD::forward
<_T2
>(__u
))
177 { return _VSTD::forward
<_T1
>(__t
) % _VSTD::forward
<_T2
>(__u
); }
178 typedef void is_transparent
;
182 #if _LIBCPP_STD_VER >= 14
183 template <class _Tp
= void>
187 struct _LIBCPP_TEMPLATE_VIS negate
188 : __unary_function
<_Tp
, _Tp
>
190 typedef _Tp __result_type
; // used by valarray
191 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
192 _Tp
operator()(const _Tp
& __x
) const
195 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(negate
);
197 #if _LIBCPP_STD_VER >= 14
199 struct _LIBCPP_TEMPLATE_VIS negate
<void>
202 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
203 auto operator()(_Tp
&& __x
) const
204 noexcept(noexcept(- _VSTD::forward
<_Tp
>(__x
)))
205 -> decltype( - _VSTD::forward
<_Tp
>(__x
))
206 { return - _VSTD::forward
<_Tp
>(__x
); }
207 typedef void is_transparent
;
211 // Bitwise operations
213 #if _LIBCPP_STD_VER >= 14
214 template <class _Tp
= void>
218 struct _LIBCPP_TEMPLATE_VIS bit_and
219 : __binary_function
<_Tp
, _Tp
, _Tp
>
221 typedef _Tp __result_type
; // used by valarray
222 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
223 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
226 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_and
);
228 #if _LIBCPP_STD_VER >= 14
230 struct _LIBCPP_TEMPLATE_VIS bit_and
<void>
232 template <class _T1
, class _T2
>
233 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
234 auto operator()(_T1
&& __t
, _T2
&& __u
) const
235 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) & _VSTD::forward
<_T2
>(__u
)))
236 -> decltype( _VSTD::forward
<_T1
>(__t
) & _VSTD::forward
<_T2
>(__u
))
237 { return _VSTD::forward
<_T1
>(__t
) & _VSTD::forward
<_T2
>(__u
); }
238 typedef void is_transparent
;
242 #if _LIBCPP_STD_VER >= 14
243 template <class _Tp
= void>
244 struct _LIBCPP_TEMPLATE_VIS bit_not
245 : __unary_function
<_Tp
, _Tp
>
247 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
248 _Tp
operator()(const _Tp
& __x
) const
251 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_not
);
254 struct _LIBCPP_TEMPLATE_VIS bit_not
<void>
257 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
258 auto operator()(_Tp
&& __x
) const
259 noexcept(noexcept(~_VSTD::forward
<_Tp
>(__x
)))
260 -> decltype( ~_VSTD::forward
<_Tp
>(__x
))
261 { return ~_VSTD::forward
<_Tp
>(__x
); }
262 typedef void is_transparent
;
266 #if _LIBCPP_STD_VER >= 14
267 template <class _Tp
= void>
271 struct _LIBCPP_TEMPLATE_VIS bit_or
272 : __binary_function
<_Tp
, _Tp
, _Tp
>
274 typedef _Tp __result_type
; // used by valarray
275 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
276 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
279 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_or
);
281 #if _LIBCPP_STD_VER >= 14
283 struct _LIBCPP_TEMPLATE_VIS bit_or
<void>
285 template <class _T1
, class _T2
>
286 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
287 auto operator()(_T1
&& __t
, _T2
&& __u
) const
288 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) | _VSTD::forward
<_T2
>(__u
)))
289 -> decltype( _VSTD::forward
<_T1
>(__t
) | _VSTD::forward
<_T2
>(__u
))
290 { return _VSTD::forward
<_T1
>(__t
) | _VSTD::forward
<_T2
>(__u
); }
291 typedef void is_transparent
;
295 #if _LIBCPP_STD_VER >= 14
296 template <class _Tp
= void>
300 struct _LIBCPP_TEMPLATE_VIS bit_xor
301 : __binary_function
<_Tp
, _Tp
, _Tp
>
303 typedef _Tp __result_type
; // used by valarray
304 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
305 _Tp
operator()(const _Tp
& __x
, const _Tp
& __y
) const
308 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_xor
);
310 #if _LIBCPP_STD_VER >= 14
312 struct _LIBCPP_TEMPLATE_VIS bit_xor
<void>
314 template <class _T1
, class _T2
>
315 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
316 auto operator()(_T1
&& __t
, _T2
&& __u
) const
317 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) ^ _VSTD::forward
<_T2
>(__u
)))
318 -> decltype( _VSTD::forward
<_T1
>(__t
) ^ _VSTD::forward
<_T2
>(__u
))
319 { return _VSTD::forward
<_T1
>(__t
) ^ _VSTD::forward
<_T2
>(__u
); }
320 typedef void is_transparent
;
324 // Comparison operations
326 #if _LIBCPP_STD_VER >= 14
327 template <class _Tp
= void>
331 struct _LIBCPP_TEMPLATE_VIS equal_to
332 : __binary_function
<_Tp
, _Tp
, bool>
334 typedef bool __result_type
; // used by valarray
335 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
336 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
339 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(equal_to
);
341 #if _LIBCPP_STD_VER >= 14
343 struct _LIBCPP_TEMPLATE_VIS equal_to
<void>
345 template <class _T1
, class _T2
>
346 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
347 auto operator()(_T1
&& __t
, _T2
&& __u
) const
348 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) == _VSTD::forward
<_T2
>(__u
)))
349 -> decltype( _VSTD::forward
<_T1
>(__t
) == _VSTD::forward
<_T2
>(__u
))
350 { return _VSTD::forward
<_T1
>(__t
) == _VSTD::forward
<_T2
>(__u
); }
351 typedef void is_transparent
;
356 struct __is_trivial_equality_predicate
<equal_to
<_Tp
>, _Tp
, _Tp
> : true_type
{};
358 #if _LIBCPP_STD_VER >= 14
360 struct __is_trivial_equality_predicate
<equal_to
<>, _Tp
, _Tp
> : true_type
{};
363 #if _LIBCPP_STD_VER >= 14
364 template <class _Tp
= void>
368 struct _LIBCPP_TEMPLATE_VIS not_equal_to
369 : __binary_function
<_Tp
, _Tp
, bool>
371 typedef bool __result_type
; // used by valarray
372 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
373 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
376 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(not_equal_to
);
378 #if _LIBCPP_STD_VER >= 14
380 struct _LIBCPP_TEMPLATE_VIS not_equal_to
<void>
382 template <class _T1
, class _T2
>
383 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
384 auto operator()(_T1
&& __t
, _T2
&& __u
) const
385 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) != _VSTD::forward
<_T2
>(__u
)))
386 -> decltype( _VSTD::forward
<_T1
>(__t
) != _VSTD::forward
<_T2
>(__u
))
387 { return _VSTD::forward
<_T1
>(__t
) != _VSTD::forward
<_T2
>(__u
); }
388 typedef void is_transparent
;
392 #if _LIBCPP_STD_VER >= 14
393 template <class _Tp
= void>
397 struct _LIBCPP_TEMPLATE_VIS less
398 : __binary_function
<_Tp
, _Tp
, bool>
400 typedef bool __result_type
; // used by valarray
401 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
402 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
405 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(less
);
407 #if _LIBCPP_STD_VER >= 14
409 struct _LIBCPP_TEMPLATE_VIS less
<void>
411 template <class _T1
, class _T2
>
412 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
413 auto operator()(_T1
&& __t
, _T2
&& __u
) const
414 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) < _VSTD::forward
<_T2
>(__u
)))
415 -> decltype( _VSTD::forward
<_T1
>(__t
) < _VSTD::forward
<_T2
>(__u
))
416 { return _VSTD::forward
<_T1
>(__t
) < _VSTD::forward
<_T2
>(__u
); }
417 typedef void is_transparent
;
421 #if _LIBCPP_STD_VER >= 14
422 template <class _Tp
= void>
426 struct _LIBCPP_TEMPLATE_VIS less_equal
427 : __binary_function
<_Tp
, _Tp
, bool>
429 typedef bool __result_type
; // used by valarray
430 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
431 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
434 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(less_equal
);
436 #if _LIBCPP_STD_VER >= 14
438 struct _LIBCPP_TEMPLATE_VIS less_equal
<void>
440 template <class _T1
, class _T2
>
441 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
442 auto operator()(_T1
&& __t
, _T2
&& __u
) const
443 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) <= _VSTD::forward
<_T2
>(__u
)))
444 -> decltype( _VSTD::forward
<_T1
>(__t
) <= _VSTD::forward
<_T2
>(__u
))
445 { return _VSTD::forward
<_T1
>(__t
) <= _VSTD::forward
<_T2
>(__u
); }
446 typedef void is_transparent
;
450 #if _LIBCPP_STD_VER >= 14
451 template <class _Tp
= void>
455 struct _LIBCPP_TEMPLATE_VIS greater_equal
456 : __binary_function
<_Tp
, _Tp
, bool>
458 typedef bool __result_type
; // used by valarray
459 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
460 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
463 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(greater_equal
);
465 #if _LIBCPP_STD_VER >= 14
467 struct _LIBCPP_TEMPLATE_VIS greater_equal
<void>
469 template <class _T1
, class _T2
>
470 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
471 auto operator()(_T1
&& __t
, _T2
&& __u
) const
472 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) >= _VSTD::forward
<_T2
>(__u
)))
473 -> decltype( _VSTD::forward
<_T1
>(__t
) >= _VSTD::forward
<_T2
>(__u
))
474 { return _VSTD::forward
<_T1
>(__t
) >= _VSTD::forward
<_T2
>(__u
); }
475 typedef void is_transparent
;
479 #if _LIBCPP_STD_VER >= 14
480 template <class _Tp
= void>
484 struct _LIBCPP_TEMPLATE_VIS greater
485 : __binary_function
<_Tp
, _Tp
, bool>
487 typedef bool __result_type
; // used by valarray
488 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
489 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
492 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(greater
);
494 #if _LIBCPP_STD_VER >= 14
496 struct _LIBCPP_TEMPLATE_VIS greater
<void>
498 template <class _T1
, class _T2
>
499 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
500 auto operator()(_T1
&& __t
, _T2
&& __u
) const
501 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) > _VSTD::forward
<_T2
>(__u
)))
502 -> decltype( _VSTD::forward
<_T1
>(__t
) > _VSTD::forward
<_T2
>(__u
))
503 { return _VSTD::forward
<_T1
>(__t
) > _VSTD::forward
<_T2
>(__u
); }
504 typedef void is_transparent
;
508 // Logical operations
510 #if _LIBCPP_STD_VER >= 14
511 template <class _Tp
= void>
515 struct _LIBCPP_TEMPLATE_VIS logical_and
516 : __binary_function
<_Tp
, _Tp
, bool>
518 typedef bool __result_type
; // used by valarray
519 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
520 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
523 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_and
);
525 #if _LIBCPP_STD_VER >= 14
527 struct _LIBCPP_TEMPLATE_VIS logical_and
<void>
529 template <class _T1
, class _T2
>
530 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
531 auto operator()(_T1
&& __t
, _T2
&& __u
) const
532 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) && _VSTD::forward
<_T2
>(__u
)))
533 -> decltype( _VSTD::forward
<_T1
>(__t
) && _VSTD::forward
<_T2
>(__u
))
534 { return _VSTD::forward
<_T1
>(__t
) && _VSTD::forward
<_T2
>(__u
); }
535 typedef void is_transparent
;
539 #if _LIBCPP_STD_VER >= 14
540 template <class _Tp
= void>
544 struct _LIBCPP_TEMPLATE_VIS logical_not
545 : __unary_function
<_Tp
, bool>
547 typedef bool __result_type
; // used by valarray
548 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
549 bool operator()(const _Tp
& __x
) const
552 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_not
);
554 #if _LIBCPP_STD_VER >= 14
556 struct _LIBCPP_TEMPLATE_VIS logical_not
<void>
559 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
560 auto operator()(_Tp
&& __x
) const
561 noexcept(noexcept(!_VSTD::forward
<_Tp
>(__x
)))
562 -> decltype( !_VSTD::forward
<_Tp
>(__x
))
563 { return !_VSTD::forward
<_Tp
>(__x
); }
564 typedef void is_transparent
;
568 #if _LIBCPP_STD_VER >= 14
569 template <class _Tp
= void>
573 struct _LIBCPP_TEMPLATE_VIS logical_or
574 : __binary_function
<_Tp
, _Tp
, bool>
576 typedef bool __result_type
; // used by valarray
577 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
578 bool operator()(const _Tp
& __x
, const _Tp
& __y
) const
581 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_or
);
583 #if _LIBCPP_STD_VER >= 14
585 struct _LIBCPP_TEMPLATE_VIS logical_or
<void>
587 template <class _T1
, class _T2
>
588 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
589 auto operator()(_T1
&& __t
, _T2
&& __u
) const
590 noexcept(noexcept(_VSTD::forward
<_T1
>(__t
) || _VSTD::forward
<_T2
>(__u
)))
591 -> decltype( _VSTD::forward
<_T1
>(__t
) || _VSTD::forward
<_T2
>(__u
))
592 { return _VSTD::forward
<_T1
>(__t
) || _VSTD::forward
<_T2
>(__u
); }
593 typedef void is_transparent
;
597 _LIBCPP_END_NAMESPACE_STD
599 #endif // _LIBCPP___FUNCTIONAL_OPERATIONS_H