mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-26 22:38: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
69
third_party/libcxx/__ranges/rend.h
vendored
69
third_party/libcxx/__ranges/rend.h
vendored
|
@ -37,60 +37,46 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
namespace ranges {
|
||||
namespace __rend {
|
||||
template <class _Tp>
|
||||
concept __member_rend =
|
||||
__can_borrow<_Tp> &&
|
||||
__workaround_52970<_Tp> &&
|
||||
requires(_Tp&& __t) {
|
||||
ranges::rbegin(__t);
|
||||
{ _LIBCPP_AUTO_CAST(__t.rend()) } -> sentinel_for<decltype(ranges::rbegin(__t))>;
|
||||
};
|
||||
concept __member_rend = __can_borrow<_Tp> && requires(_Tp&& __t) {
|
||||
ranges::rbegin(__t);
|
||||
{ _LIBCPP_AUTO_CAST(__t.rend()) } -> sentinel_for<decltype(ranges::rbegin(__t))>;
|
||||
};
|
||||
|
||||
void rend(auto&) = delete;
|
||||
void rend(const auto&) = delete;
|
||||
void rend() = delete;
|
||||
|
||||
template <class _Tp>
|
||||
concept __unqualified_rend =
|
||||
!__member_rend<_Tp> &&
|
||||
__can_borrow<_Tp> &&
|
||||
__class_or_enum<remove_cvref_t<_Tp>> &&
|
||||
requires(_Tp&& __t) {
|
||||
ranges::rbegin(__t);
|
||||
{ _LIBCPP_AUTO_CAST(rend(__t)) } -> sentinel_for<decltype(ranges::rbegin(__t))>;
|
||||
};
|
||||
!__member_rend<_Tp> && __can_borrow<_Tp> && __class_or_enum<remove_cvref_t<_Tp>> && requires(_Tp&& __t) {
|
||||
ranges::rbegin(__t);
|
||||
{ _LIBCPP_AUTO_CAST(rend(__t)) } -> sentinel_for<decltype(ranges::rbegin(__t))>;
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
concept __can_reverse =
|
||||
__can_borrow<_Tp> &&
|
||||
!__member_rend<_Tp> &&
|
||||
!__unqualified_rend<_Tp> &&
|
||||
requires(_Tp&& __t) {
|
||||
{ ranges::begin(__t) } -> same_as<decltype(ranges::end(__t))>;
|
||||
{ ranges::begin(__t) } -> bidirectional_iterator;
|
||||
};
|
||||
concept __can_reverse = __can_borrow<_Tp> && !__member_rend<_Tp> && !__unqualified_rend<_Tp> && requires(_Tp&& __t) {
|
||||
{ ranges::begin(__t) } -> same_as<decltype(ranges::end(__t))>;
|
||||
{ ranges::begin(__t) } -> bidirectional_iterator;
|
||||
};
|
||||
|
||||
class __fn {
|
||||
public:
|
||||
template <class _Tp>
|
||||
requires __member_rend<_Tp>
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
|
||||
noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.rend())))
|
||||
{
|
||||
noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.rend()))) {
|
||||
return _LIBCPP_AUTO_CAST(__t.rend());
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
requires __unqualified_rend<_Tp>
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
|
||||
noexcept(noexcept(_LIBCPP_AUTO_CAST(rend(__t))))
|
||||
{
|
||||
noexcept(noexcept(_LIBCPP_AUTO_CAST(rend(__t)))) {
|
||||
return _LIBCPP_AUTO_CAST(rend(__t));
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
requires __can_reverse<_Tp>
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
|
||||
noexcept(noexcept(ranges::begin(__t)))
|
||||
{
|
||||
noexcept(noexcept(ranges::begin(__t))) {
|
||||
return std::make_reverse_iterator(ranges::begin(__t));
|
||||
}
|
||||
|
||||
|
@ -99,7 +85,7 @@ public:
|
|||
} // namespace __rend
|
||||
|
||||
inline namespace __cpo {
|
||||
inline constexpr auto rend = __rend::__fn{};
|
||||
inline constexpr auto rend = __rend::__fn{};
|
||||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
|
@ -110,24 +96,23 @@ namespace __crend {
|
|||
struct __fn {
|
||||
template <class _Tp>
|
||||
requires is_lvalue_reference_v<_Tp&&>
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI
|
||||
constexpr auto operator()(_Tp&& __t) const
|
||||
noexcept(noexcept(ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t))))
|
||||
-> decltype( ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t)))
|
||||
{ return ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t)); }
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
|
||||
noexcept(noexcept(ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t))))
|
||||
-> decltype(ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t))) {
|
||||
return ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t));
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
requires is_rvalue_reference_v<_Tp&&>
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI
|
||||
constexpr auto operator()(_Tp&& __t) const
|
||||
noexcept(noexcept(ranges::rend(static_cast<const _Tp&&>(__t))))
|
||||
-> decltype( ranges::rend(static_cast<const _Tp&&>(__t)))
|
||||
{ return ranges::rend(static_cast<const _Tp&&>(__t)); }
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(
|
||||
noexcept(ranges::rend(static_cast<const _Tp&&>(__t)))) -> decltype(ranges::rend(static_cast<const _Tp&&>(__t))) {
|
||||
return ranges::rend(static_cast<const _Tp&&>(__t));
|
||||
}
|
||||
};
|
||||
} // namespace __crend
|
||||
|
||||
inline namespace __cpo {
|
||||
inline constexpr auto crend = __crend::__fn{};
|
||||
inline constexpr auto crend = __crend::__fn{};
|
||||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue