mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 19:22:27 +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
32
third_party/libcxx/__memory/temp_value.h
vendored
32
third_party/libcxx/__memory/temp_value.h
vendored
|
@ -23,32 +23,34 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
|
||||
template <class _Tp, class _Alloc>
|
||||
struct __temp_value {
|
||||
typedef allocator_traits<_Alloc> _Traits;
|
||||
typedef allocator_traits<_Alloc> _Traits;
|
||||
|
||||
#ifdef _LIBCPP_CXX03_LANG
|
||||
typename aligned_storage<sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)>::type __v;
|
||||
typename aligned_storage<sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)>::type __v;
|
||||
#else
|
||||
union { _Tp __v; };
|
||||
union {
|
||||
_Tp __v;
|
||||
};
|
||||
#endif
|
||||
_Alloc &__a;
|
||||
_Alloc& __a;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp *__addr() {
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* __addr() {
|
||||
#ifdef _LIBCPP_CXX03_LANG
|
||||
return reinterpret_cast<_Tp*>(std::addressof(__v));
|
||||
return reinterpret_cast<_Tp*>(std::addressof(__v));
|
||||
#else
|
||||
return std::addressof(__v);
|
||||
return std::addressof(__v);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp & get() { return *__addr(); }
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& get() { return *__addr(); }
|
||||
|
||||
template<class... _Args>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc) {
|
||||
_Traits::construct(__a, __addr(), std::forward<_Args>(__args)...);
|
||||
}
|
||||
template <class... _Args>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _LIBCPP_CONSTEXPR_SINCE_CXX20 __temp_value(_Alloc& __alloc, _Args&&... __args)
|
||||
: __a(__alloc) {
|
||||
_Traits::construct(__a, __addr(), std::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__temp_value() { _Traits::destroy(__a, __addr()); }
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__temp_value() { _Traits::destroy(__a, __addr()); }
|
||||
};
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue