mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Release Cosmopolitan v3.6.0
This release is an atomic upgrade to GCC 14.1.0 with C23 and C++23
This commit is contained in:
parent
62ace3623a
commit
5660ec4741
1585 changed files with 117353 additions and 271644 deletions
26
third_party/libcxx/__functional/not_fn.h
vendored
26
third_party/libcxx/__functional/not_fn.h
vendored
|
@ -16,7 +16,6 @@
|
|||
#include <__type_traits/decay.h>
|
||||
#include <__type_traits/enable_if.h>
|
||||
#include <__type_traits/is_constructible.h>
|
||||
#include <__type_traits/is_move_constructible.h>
|
||||
#include <__utility/forward.h>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
|
@ -28,26 +27,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(!_VSTD::invoke(_VSTD::forward<_Args>(__args)...)))
|
||||
-> decltype( !_VSTD::invoke(_VSTD::forward<_Args>(__args)...))
|
||||
{ return !_VSTD::invoke(_VSTD::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>>(_VSTD::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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue