Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:31

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___CXX03___FUNCTIONAL_OPERATIONS_H
0011 #define _LIBCPP___CXX03___FUNCTIONAL_OPERATIONS_H
0012 
0013 #include <__cxx03/__config>
0014 #include <__cxx03/__functional/binary_function.h>
0015 #include <__cxx03/__functional/unary_function.h>
0016 #include <__cxx03/__type_traits/desugars_to.h>
0017 #include <__cxx03/__utility/forward.h>
0018 
0019 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0020 #  pragma GCC system_header
0021 #endif
0022 
0023 _LIBCPP_BEGIN_NAMESPACE_STD
0024 
0025 // Arithmetic operations
0026 
0027 #if _LIBCPP_STD_VER >= 14
0028 template <class _Tp = void>
0029 #else
0030 template <class _Tp>
0031 #endif
0032 struct _LIBCPP_TEMPLATE_VIS plus : __binary_function<_Tp, _Tp, _Tp> {
0033   typedef _Tp __result_type; // used by valarray
0034   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
0035     return __x + __y;
0036   }
0037 };
0038 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(plus);
0039 
0040 // The non-transparent std::plus specialization is only equivalent to a raw plus
0041 // operator when we don't perform an implicit conversion when calling it.
0042 template <class _Tp>
0043 inline const bool __desugars_to_v<__plus_tag, plus<_Tp>, _Tp, _Tp> = true;
0044 
0045 template <class _Tp, class _Up>
0046 inline const bool __desugars_to_v<__plus_tag, plus<void>, _Tp, _Up> = true;
0047 
0048 #if _LIBCPP_STD_VER >= 14
0049 template <>
0050 struct _LIBCPP_TEMPLATE_VIS plus<void> {
0051   template <class _T1, class _T2>
0052   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0053       noexcept(noexcept(std::forward<_T1>(__t) + std::forward<_T2>(__u))) //
0054       -> decltype(std::forward<_T1>(__t) + std::forward<_T2>(__u)) {
0055     return std::forward<_T1>(__t) + std::forward<_T2>(__u);
0056   }
0057   typedef void is_transparent;
0058 };
0059 #endif
0060 
0061 #if _LIBCPP_STD_VER >= 14
0062 template <class _Tp = void>
0063 #else
0064 template <class _Tp>
0065 #endif
0066 struct _LIBCPP_TEMPLATE_VIS minus : __binary_function<_Tp, _Tp, _Tp> {
0067   typedef _Tp __result_type; // used by valarray
0068   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
0069     return __x - __y;
0070   }
0071 };
0072 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(minus);
0073 
0074 #if _LIBCPP_STD_VER >= 14
0075 template <>
0076 struct _LIBCPP_TEMPLATE_VIS minus<void> {
0077   template <class _T1, class _T2>
0078   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0079       noexcept(noexcept(std::forward<_T1>(__t) - std::forward<_T2>(__u))) //
0080       -> decltype(std::forward<_T1>(__t) - std::forward<_T2>(__u)) {
0081     return std::forward<_T1>(__t) - std::forward<_T2>(__u);
0082   }
0083   typedef void is_transparent;
0084 };
0085 #endif
0086 
0087 #if _LIBCPP_STD_VER >= 14
0088 template <class _Tp = void>
0089 #else
0090 template <class _Tp>
0091 #endif
0092 struct _LIBCPP_TEMPLATE_VIS multiplies : __binary_function<_Tp, _Tp, _Tp> {
0093   typedef _Tp __result_type; // used by valarray
0094   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
0095     return __x * __y;
0096   }
0097 };
0098 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(multiplies);
0099 
0100 #if _LIBCPP_STD_VER >= 14
0101 template <>
0102 struct _LIBCPP_TEMPLATE_VIS multiplies<void> {
0103   template <class _T1, class _T2>
0104   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0105       noexcept(noexcept(std::forward<_T1>(__t) * std::forward<_T2>(__u))) //
0106       -> decltype(std::forward<_T1>(__t) * std::forward<_T2>(__u)) {
0107     return std::forward<_T1>(__t) * std::forward<_T2>(__u);
0108   }
0109   typedef void is_transparent;
0110 };
0111 #endif
0112 
0113 #if _LIBCPP_STD_VER >= 14
0114 template <class _Tp = void>
0115 #else
0116 template <class _Tp>
0117 #endif
0118 struct _LIBCPP_TEMPLATE_VIS divides : __binary_function<_Tp, _Tp, _Tp> {
0119   typedef _Tp __result_type; // used by valarray
0120   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
0121     return __x / __y;
0122   }
0123 };
0124 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(divides);
0125 
0126 #if _LIBCPP_STD_VER >= 14
0127 template <>
0128 struct _LIBCPP_TEMPLATE_VIS divides<void> {
0129   template <class _T1, class _T2>
0130   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0131       noexcept(noexcept(std::forward<_T1>(__t) / std::forward<_T2>(__u))) //
0132       -> decltype(std::forward<_T1>(__t) / std::forward<_T2>(__u)) {
0133     return std::forward<_T1>(__t) / std::forward<_T2>(__u);
0134   }
0135   typedef void is_transparent;
0136 };
0137 #endif
0138 
0139 #if _LIBCPP_STD_VER >= 14
0140 template <class _Tp = void>
0141 #else
0142 template <class _Tp>
0143 #endif
0144 struct _LIBCPP_TEMPLATE_VIS modulus : __binary_function<_Tp, _Tp, _Tp> {
0145   typedef _Tp __result_type; // used by valarray
0146   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
0147     return __x % __y;
0148   }
0149 };
0150 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(modulus);
0151 
0152 #if _LIBCPP_STD_VER >= 14
0153 template <>
0154 struct _LIBCPP_TEMPLATE_VIS modulus<void> {
0155   template <class _T1, class _T2>
0156   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0157       noexcept(noexcept(std::forward<_T1>(__t) % std::forward<_T2>(__u))) //
0158       -> decltype(std::forward<_T1>(__t) % std::forward<_T2>(__u)) {
0159     return std::forward<_T1>(__t) % std::forward<_T2>(__u);
0160   }
0161   typedef void is_transparent;
0162 };
0163 #endif
0164 
0165 #if _LIBCPP_STD_VER >= 14
0166 template <class _Tp = void>
0167 #else
0168 template <class _Tp>
0169 #endif
0170 struct _LIBCPP_TEMPLATE_VIS negate : __unary_function<_Tp, _Tp> {
0171   typedef _Tp __result_type; // used by valarray
0172   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x) const { return -__x; }
0173 };
0174 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(negate);
0175 
0176 #if _LIBCPP_STD_VER >= 14
0177 template <>
0178 struct _LIBCPP_TEMPLATE_VIS negate<void> {
0179   template <class _Tp>
0180   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_Tp&& __x) const
0181       noexcept(noexcept(-std::forward<_Tp>(__x))) //
0182       -> decltype(-std::forward<_Tp>(__x)) {
0183     return -std::forward<_Tp>(__x);
0184   }
0185   typedef void is_transparent;
0186 };
0187 #endif
0188 
0189 // Bitwise operations
0190 
0191 #if _LIBCPP_STD_VER >= 14
0192 template <class _Tp = void>
0193 #else
0194 template <class _Tp>
0195 #endif
0196 struct _LIBCPP_TEMPLATE_VIS bit_and : __binary_function<_Tp, _Tp, _Tp> {
0197   typedef _Tp __result_type; // used by valarray
0198   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
0199     return __x & __y;
0200   }
0201 };
0202 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_and);
0203 
0204 #if _LIBCPP_STD_VER >= 14
0205 template <>
0206 struct _LIBCPP_TEMPLATE_VIS bit_and<void> {
0207   template <class _T1, class _T2>
0208   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0209       noexcept(noexcept(std::forward<_T1>(__t) &
0210                         std::forward<_T2>(__u))) -> decltype(std::forward<_T1>(__t) & std::forward<_T2>(__u)) {
0211     return std::forward<_T1>(__t) & std::forward<_T2>(__u);
0212   }
0213   typedef void is_transparent;
0214 };
0215 #endif
0216 
0217 #if _LIBCPP_STD_VER >= 14
0218 template <class _Tp = void>
0219 struct _LIBCPP_TEMPLATE_VIS bit_not : __unary_function<_Tp, _Tp> {
0220   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x) const { return ~__x; }
0221 };
0222 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_not);
0223 
0224 template <>
0225 struct _LIBCPP_TEMPLATE_VIS bit_not<void> {
0226   template <class _Tp>
0227   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_Tp&& __x) const
0228       noexcept(noexcept(~std::forward<_Tp>(__x))) //
0229       -> decltype(~std::forward<_Tp>(__x)) {
0230     return ~std::forward<_Tp>(__x);
0231   }
0232   typedef void is_transparent;
0233 };
0234 #endif
0235 
0236 #if _LIBCPP_STD_VER >= 14
0237 template <class _Tp = void>
0238 #else
0239 template <class _Tp>
0240 #endif
0241 struct _LIBCPP_TEMPLATE_VIS bit_or : __binary_function<_Tp, _Tp, _Tp> {
0242   typedef _Tp __result_type; // used by valarray
0243   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
0244     return __x | __y;
0245   }
0246 };
0247 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_or);
0248 
0249 #if _LIBCPP_STD_VER >= 14
0250 template <>
0251 struct _LIBCPP_TEMPLATE_VIS bit_or<void> {
0252   template <class _T1, class _T2>
0253   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0254       noexcept(noexcept(std::forward<_T1>(__t) | std::forward<_T2>(__u))) //
0255       -> decltype(std::forward<_T1>(__t) | std::forward<_T2>(__u)) {
0256     return std::forward<_T1>(__t) | std::forward<_T2>(__u);
0257   }
0258   typedef void is_transparent;
0259 };
0260 #endif
0261 
0262 #if _LIBCPP_STD_VER >= 14
0263 template <class _Tp = void>
0264 #else
0265 template <class _Tp>
0266 #endif
0267 struct _LIBCPP_TEMPLATE_VIS bit_xor : __binary_function<_Tp, _Tp, _Tp> {
0268   typedef _Tp __result_type; // used by valarray
0269   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
0270     return __x ^ __y;
0271   }
0272 };
0273 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_xor);
0274 
0275 #if _LIBCPP_STD_VER >= 14
0276 template <>
0277 struct _LIBCPP_TEMPLATE_VIS bit_xor<void> {
0278   template <class _T1, class _T2>
0279   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0280       noexcept(noexcept(std::forward<_T1>(__t) ^ std::forward<_T2>(__u))) //
0281       -> decltype(std::forward<_T1>(__t) ^ std::forward<_T2>(__u)) {
0282     return std::forward<_T1>(__t) ^ std::forward<_T2>(__u);
0283   }
0284   typedef void is_transparent;
0285 };
0286 #endif
0287 
0288 // Comparison operations
0289 
0290 #if _LIBCPP_STD_VER >= 14
0291 template <class _Tp = void>
0292 #else
0293 template <class _Tp>
0294 #endif
0295 struct _LIBCPP_TEMPLATE_VIS equal_to : __binary_function<_Tp, _Tp, bool> {
0296   typedef bool __result_type; // used by valarray
0297   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
0298     return __x == __y;
0299   }
0300 };
0301 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(equal_to);
0302 
0303 #if _LIBCPP_STD_VER >= 14
0304 template <>
0305 struct _LIBCPP_TEMPLATE_VIS equal_to<void> {
0306   template <class _T1, class _T2>
0307   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0308       noexcept(noexcept(std::forward<_T1>(__t) == std::forward<_T2>(__u))) //
0309       -> decltype(std::forward<_T1>(__t) == std::forward<_T2>(__u)) {
0310     return std::forward<_T1>(__t) == std::forward<_T2>(__u);
0311   }
0312   typedef void is_transparent;
0313 };
0314 #endif
0315 
0316 // The non-transparent std::equal_to specialization is only equivalent to a raw equality
0317 // comparison when we don't perform an implicit conversion when calling it.
0318 template <class _Tp>
0319 inline const bool __desugars_to_v<__equal_tag, equal_to<_Tp>, _Tp, _Tp> = true;
0320 
0321 // In the transparent case, we do not enforce that
0322 template <class _Tp, class _Up>
0323 inline const bool __desugars_to_v<__equal_tag, equal_to<void>, _Tp, _Up> = true;
0324 
0325 #if _LIBCPP_STD_VER >= 14
0326 template <class _Tp = void>
0327 #else
0328 template <class _Tp>
0329 #endif
0330 struct _LIBCPP_TEMPLATE_VIS not_equal_to : __binary_function<_Tp, _Tp, bool> {
0331   typedef bool __result_type; // used by valarray
0332   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
0333     return __x != __y;
0334   }
0335 };
0336 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(not_equal_to);
0337 
0338 #if _LIBCPP_STD_VER >= 14
0339 template <>
0340 struct _LIBCPP_TEMPLATE_VIS not_equal_to<void> {
0341   template <class _T1, class _T2>
0342   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0343       noexcept(noexcept(std::forward<_T1>(__t) != std::forward<_T2>(__u))) //
0344       -> decltype(std::forward<_T1>(__t) != std::forward<_T2>(__u)) {
0345     return std::forward<_T1>(__t) != std::forward<_T2>(__u);
0346   }
0347   typedef void is_transparent;
0348 };
0349 #endif
0350 
0351 #if _LIBCPP_STD_VER >= 14
0352 template <class _Tp = void>
0353 #else
0354 template <class _Tp>
0355 #endif
0356 struct _LIBCPP_TEMPLATE_VIS less : __binary_function<_Tp, _Tp, bool> {
0357   typedef bool __result_type; // used by valarray
0358   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
0359     return __x < __y;
0360   }
0361 };
0362 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(less);
0363 
0364 template <class _Tp>
0365 inline const bool __desugars_to_v<__less_tag, less<_Tp>, _Tp, _Tp> = true;
0366 
0367 #if _LIBCPP_STD_VER >= 14
0368 template <>
0369 struct _LIBCPP_TEMPLATE_VIS less<void> {
0370   template <class _T1, class _T2>
0371   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0372       noexcept(noexcept(std::forward<_T1>(__t) < std::forward<_T2>(__u))) //
0373       -> decltype(std::forward<_T1>(__t) < std::forward<_T2>(__u)) {
0374     return std::forward<_T1>(__t) < std::forward<_T2>(__u);
0375   }
0376   typedef void is_transparent;
0377 };
0378 
0379 template <class _Tp>
0380 inline const bool __desugars_to_v<__less_tag, less<>, _Tp, _Tp> = true;
0381 #endif
0382 
0383 #if _LIBCPP_STD_VER >= 14
0384 template <class _Tp = void>
0385 #else
0386 template <class _Tp>
0387 #endif
0388 struct _LIBCPP_TEMPLATE_VIS less_equal : __binary_function<_Tp, _Tp, bool> {
0389   typedef bool __result_type; // used by valarray
0390   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
0391     return __x <= __y;
0392   }
0393 };
0394 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(less_equal);
0395 
0396 #if _LIBCPP_STD_VER >= 14
0397 template <>
0398 struct _LIBCPP_TEMPLATE_VIS less_equal<void> {
0399   template <class _T1, class _T2>
0400   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0401       noexcept(noexcept(std::forward<_T1>(__t) <= std::forward<_T2>(__u))) //
0402       -> decltype(std::forward<_T1>(__t) <= std::forward<_T2>(__u)) {
0403     return std::forward<_T1>(__t) <= std::forward<_T2>(__u);
0404   }
0405   typedef void is_transparent;
0406 };
0407 #endif
0408 
0409 #if _LIBCPP_STD_VER >= 14
0410 template <class _Tp = void>
0411 #else
0412 template <class _Tp>
0413 #endif
0414 struct _LIBCPP_TEMPLATE_VIS greater_equal : __binary_function<_Tp, _Tp, bool> {
0415   typedef bool __result_type; // used by valarray
0416   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
0417     return __x >= __y;
0418   }
0419 };
0420 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(greater_equal);
0421 
0422 #if _LIBCPP_STD_VER >= 14
0423 template <>
0424 struct _LIBCPP_TEMPLATE_VIS greater_equal<void> {
0425   template <class _T1, class _T2>
0426   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0427       noexcept(noexcept(std::forward<_T1>(__t) >=
0428                         std::forward<_T2>(__u))) -> decltype(std::forward<_T1>(__t) >= std::forward<_T2>(__u)) {
0429     return std::forward<_T1>(__t) >= std::forward<_T2>(__u);
0430   }
0431   typedef void is_transparent;
0432 };
0433 #endif
0434 
0435 #if _LIBCPP_STD_VER >= 14
0436 template <class _Tp = void>
0437 #else
0438 template <class _Tp>
0439 #endif
0440 struct _LIBCPP_TEMPLATE_VIS greater : __binary_function<_Tp, _Tp, bool> {
0441   typedef bool __result_type; // used by valarray
0442   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
0443     return __x > __y;
0444   }
0445 };
0446 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(greater);
0447 
0448 #if _LIBCPP_STD_VER >= 14
0449 template <>
0450 struct _LIBCPP_TEMPLATE_VIS greater<void> {
0451   template <class _T1, class _T2>
0452   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0453       noexcept(noexcept(std::forward<_T1>(__t) > std::forward<_T2>(__u))) //
0454       -> decltype(std::forward<_T1>(__t) > std::forward<_T2>(__u)) {
0455     return std::forward<_T1>(__t) > std::forward<_T2>(__u);
0456   }
0457   typedef void is_transparent;
0458 };
0459 #endif
0460 
0461 // Logical operations
0462 
0463 #if _LIBCPP_STD_VER >= 14
0464 template <class _Tp = void>
0465 #else
0466 template <class _Tp>
0467 #endif
0468 struct _LIBCPP_TEMPLATE_VIS logical_and : __binary_function<_Tp, _Tp, bool> {
0469   typedef bool __result_type; // used by valarray
0470   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
0471     return __x && __y;
0472   }
0473 };
0474 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_and);
0475 
0476 #if _LIBCPP_STD_VER >= 14
0477 template <>
0478 struct _LIBCPP_TEMPLATE_VIS logical_and<void> {
0479   template <class _T1, class _T2>
0480   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0481       noexcept(noexcept(std::forward<_T1>(__t) && std::forward<_T2>(__u))) //
0482       -> decltype(std::forward<_T1>(__t) && std::forward<_T2>(__u)) {
0483     return std::forward<_T1>(__t) && std::forward<_T2>(__u);
0484   }
0485   typedef void is_transparent;
0486 };
0487 #endif
0488 
0489 #if _LIBCPP_STD_VER >= 14
0490 template <class _Tp = void>
0491 #else
0492 template <class _Tp>
0493 #endif
0494 struct _LIBCPP_TEMPLATE_VIS logical_not : __unary_function<_Tp, bool> {
0495   typedef bool __result_type; // used by valarray
0496   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x) const { return !__x; }
0497 };
0498 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_not);
0499 
0500 #if _LIBCPP_STD_VER >= 14
0501 template <>
0502 struct _LIBCPP_TEMPLATE_VIS logical_not<void> {
0503   template <class _Tp>
0504   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_Tp&& __x) const
0505       noexcept(noexcept(!std::forward<_Tp>(__x))) //
0506       -> decltype(!std::forward<_Tp>(__x)) {
0507     return !std::forward<_Tp>(__x);
0508   }
0509   typedef void is_transparent;
0510 };
0511 #endif
0512 
0513 #if _LIBCPP_STD_VER >= 14
0514 template <class _Tp = void>
0515 #else
0516 template <class _Tp>
0517 #endif
0518 struct _LIBCPP_TEMPLATE_VIS logical_or : __binary_function<_Tp, _Tp, bool> {
0519   typedef bool __result_type; // used by valarray
0520   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
0521     return __x || __y;
0522   }
0523 };
0524 _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_or);
0525 
0526 #if _LIBCPP_STD_VER >= 14
0527 template <>
0528 struct _LIBCPP_TEMPLATE_VIS logical_or<void> {
0529   template <class _T1, class _T2>
0530   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0531       noexcept(noexcept(std::forward<_T1>(__t) || std::forward<_T2>(__u))) //
0532       -> decltype(std::forward<_T1>(__t) || std::forward<_T2>(__u)) {
0533     return std::forward<_T1>(__t) || std::forward<_T2>(__u);
0534   }
0535   typedef void is_transparent;
0536 };
0537 #endif
0538 
0539 _LIBCPP_END_NAMESPACE_STD
0540 
0541 #endif // _LIBCPP___CXX03___FUNCTIONAL_OPERATIONS_H