mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-02 18:52:29 +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
|
@ -29,33 +29,33 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
#if _LIBCPP_STD_VER >= 20
|
||||
|
||||
// [incrementable.traits]
|
||||
template<class> struct incrementable_traits {};
|
||||
template <class>
|
||||
struct incrementable_traits {};
|
||||
|
||||
template<class _Tp>
|
||||
requires is_object_v<_Tp>
|
||||
template <class _Tp>
|
||||
requires is_object_v<_Tp>
|
||||
struct incrementable_traits<_Tp*> {
|
||||
using difference_type = ptrdiff_t;
|
||||
};
|
||||
|
||||
template<class _Ip>
|
||||
template <class _Ip>
|
||||
struct incrementable_traits<const _Ip> : incrementable_traits<_Ip> {};
|
||||
|
||||
template<class _Tp>
|
||||
template <class _Tp>
|
||||
concept __has_member_difference_type = requires { typename _Tp::difference_type; };
|
||||
|
||||
template<__has_member_difference_type _Tp>
|
||||
template <__has_member_difference_type _Tp>
|
||||
struct incrementable_traits<_Tp> {
|
||||
using difference_type = typename _Tp::difference_type;
|
||||
};
|
||||
|
||||
template<class _Tp>
|
||||
concept __has_integral_minus =
|
||||
requires(const _Tp& __x, const _Tp& __y) {
|
||||
{ __x - __y } -> integral;
|
||||
};
|
||||
template <class _Tp>
|
||||
concept __has_integral_minus = requires(const _Tp& __x, const _Tp& __y) {
|
||||
{ __x - __y } -> integral;
|
||||
};
|
||||
|
||||
template<__has_integral_minus _Tp>
|
||||
requires (!__has_member_difference_type<_Tp>)
|
||||
template <__has_integral_minus _Tp>
|
||||
requires(!__has_member_difference_type<_Tp>)
|
||||
struct incrementable_traits<_Tp> {
|
||||
using difference_type = make_signed_t<decltype(std::declval<_Tp>() - std::declval<_Tp>())>;
|
||||
};
|
||||
|
@ -67,9 +67,10 @@ struct iterator_traits;
|
|||
// `incrementable_traits<RI>::difference_type` if `iterator_traits<RI>` names a specialization
|
||||
// generated from the primary template, and `iterator_traits<RI>::difference_type` otherwise.
|
||||
template <class _Ip>
|
||||
using iter_difference_t = typename conditional_t<__is_primary_template<iterator_traits<remove_cvref_t<_Ip> > >::value,
|
||||
incrementable_traits<remove_cvref_t<_Ip> >,
|
||||
iterator_traits<remove_cvref_t<_Ip> > >::difference_type;
|
||||
using iter_difference_t =
|
||||
typename conditional_t<__is_primary_template<iterator_traits<remove_cvref_t<_Ip> > >::value,
|
||||
incrementable_traits<remove_cvref_t<_Ip> >,
|
||||
iterator_traits<remove_cvref_t<_Ip> > >::difference_type;
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 20
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue