aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__functional/not_fn.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__functional/not_fn.h')
-rw-r--r--contrib/llvm-project/libcxx/include/__functional/not_fn.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/contrib/llvm-project/libcxx/include/__functional/not_fn.h b/contrib/llvm-project/libcxx/include/__functional/not_fn.h
index bbd1a8bc35af..23a491c135d7 100644
--- a/contrib/llvm-project/libcxx/include/__functional/not_fn.h
+++ b/contrib/llvm-project/libcxx/include/__functional/not_fn.h
@@ -28,26 +28,23 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 17
struct __not_fn_op {
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI
- _LIBCPP_CONSTEXPR_SINCE_CXX20 auto operator()(_Args&&... __args) const
- noexcept(noexcept(!std::invoke(std::forward<_Args>(__args)...)))
- -> decltype( !std::invoke(std::forward<_Args>(__args)...))
- { return !std::invoke(std::forward<_Args>(__args)...); }
+ template <class... _Args>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 auto operator()(_Args&&... __args) const
+ noexcept(noexcept(!std::invoke(std::forward<_Args>(__args)...)))
+ -> decltype(!std::invoke(std::forward<_Args>(__args)...)) {
+ return !std::invoke(std::forward<_Args>(__args)...);
+ }
};
template <class _Fn>
struct __not_fn_t : __perfect_forward<__not_fn_op, _Fn> {
- using __perfect_forward<__not_fn_op, _Fn>::__perfect_forward;
+ using __perfect_forward<__not_fn_op, _Fn>::__perfect_forward;
};
-template <class _Fn, class = enable_if_t<
- is_constructible_v<decay_t<_Fn>, _Fn> &&
- is_move_constructible_v<decay_t<_Fn>>
->>
-_LIBCPP_HIDE_FROM_ABI
-_LIBCPP_CONSTEXPR_SINCE_CXX20 auto not_fn(_Fn&& __f) {
- return __not_fn_t<decay_t<_Fn>>(std::forward<_Fn>(__f));
+template <class _Fn,
+ class = enable_if_t< is_constructible_v<decay_t<_Fn>, _Fn> && is_move_constructible_v<decay_t<_Fn>> >>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 auto not_fn(_Fn&& __f) {
+ return __not_fn_t<decay_t<_Fn>>(std::forward<_Fn>(__f));
}
#endif // _LIBCPP_STD_VER >= 17