diff options
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__functional/unary_negate.h')
-rw-r--r-- | contrib/llvm-project/libcxx/include/__functional/unary_negate.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/contrib/llvm-project/libcxx/include/__functional/unary_negate.h b/contrib/llvm-project/libcxx/include/__functional/unary_negate.h index b2eed8e2db35..d130b7d728a2 100644 --- a/contrib/llvm-project/libcxx/include/__functional/unary_negate.h +++ b/contrib/llvm-project/libcxx/include/__functional/unary_negate.h @@ -23,22 +23,23 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Predicate> class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 unary_negate - : public __unary_function<typename _Predicate::argument_type, bool> -{ - _Predicate __pred_; + : public __unary_function<typename _Predicate::argument_type, bool> { + _Predicate __pred_; + public: - _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI - explicit unary_negate(const _Predicate& __pred) - : __pred_(__pred) {} - _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI - bool operator()(const typename _Predicate::argument_type& __x) const - {return !__pred_(__x);} + _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI explicit unary_negate(const _Predicate& __pred) + : __pred_(__pred) {} + _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool + operator()(const typename _Predicate::argument_type& __x) const { + return !__pred_(__x); + } }; template <class _Predicate> -_LIBCPP_DEPRECATED_IN_CXX17 inline _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI -unary_negate<_Predicate> -not1(const _Predicate& __pred) {return unary_negate<_Predicate>(__pred);} +_LIBCPP_DEPRECATED_IN_CXX17 inline _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI unary_negate<_Predicate> +not1(const _Predicate& __pred) { + return unary_negate<_Predicate>(__pred); +} #endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS) |