File indexing completed on 2026-05-03 08:13:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H
0011 #define _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H
0012
0013 #include <__config>
0014 #include <__functional/binary_function.h>
0015
0016 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0017 # pragma GCC system_header
0018 #endif
0019
0020 _LIBCPP_BEGIN_NAMESPACE_STD
0021
0022 #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
0023
0024 template <class _Predicate>
0025 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 binary_negate
0026 : public __binary_function<typename _Predicate::first_argument_type,
0027 typename _Predicate::second_argument_type,
0028 bool> {
0029 _Predicate __pred_;
0030
0031 public:
0032 _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR_SINCE_CXX14 binary_negate(const _Predicate& __pred)
0033 : __pred_(__pred) {}
0034
0035 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(
0036 const typename _Predicate::first_argument_type& __x, const typename _Predicate::second_argument_type& __y) const {
0037 return !__pred_(__x, __y);
0038 }
0039 };
0040
0041 template <class _Predicate>
0042 _LIBCPP_DEPRECATED_IN_CXX17 inline _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI binary_negate<_Predicate>
0043 not2(const _Predicate& __pred) {
0044 return binary_negate<_Predicate>(__pred);
0045 }
0046
0047 #endif
0048
0049 _LIBCPP_END_NAMESPACE_STD
0050
0051 #endif