mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-05 04:02:28 +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
66
third_party/libcxx/__ranges/rbegin.h
vendored
66
third_party/libcxx/__ranges/rbegin.h
vendored
|
@ -36,57 +36,43 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
namespace ranges {
|
||||
namespace __rbegin {
|
||||
template <class _Tp>
|
||||
concept __member_rbegin =
|
||||
__can_borrow<_Tp> &&
|
||||
__workaround_52970<_Tp> &&
|
||||
requires(_Tp&& __t) {
|
||||
{ _LIBCPP_AUTO_CAST(__t.rbegin()) } -> input_or_output_iterator;
|
||||
};
|
||||
concept __member_rbegin = __can_borrow<_Tp> && requires(_Tp&& __t) {
|
||||
{ _LIBCPP_AUTO_CAST(__t.rbegin()) } -> input_or_output_iterator;
|
||||
};
|
||||
|
||||
void rbegin(auto&) = delete;
|
||||
void rbegin(const auto&) = delete;
|
||||
void rbegin() = delete;
|
||||
|
||||
template <class _Tp>
|
||||
concept __unqualified_rbegin =
|
||||
!__member_rbegin<_Tp> &&
|
||||
__can_borrow<_Tp> &&
|
||||
__class_or_enum<remove_cvref_t<_Tp>> &&
|
||||
requires(_Tp&& __t) {
|
||||
{ _LIBCPP_AUTO_CAST(rbegin(__t)) } -> input_or_output_iterator;
|
||||
};
|
||||
!__member_rbegin<_Tp> && __can_borrow<_Tp> && __class_or_enum<remove_cvref_t<_Tp>> && requires(_Tp&& __t) {
|
||||
{ _LIBCPP_AUTO_CAST(rbegin(__t)) } -> input_or_output_iterator;
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
concept __can_reverse =
|
||||
__can_borrow<_Tp> &&
|
||||
!__member_rbegin<_Tp> &&
|
||||
!__unqualified_rbegin<_Tp> &&
|
||||
requires(_Tp&& __t) {
|
||||
{ ranges::begin(__t) } -> same_as<decltype(ranges::end(__t))>;
|
||||
{ ranges::begin(__t) } -> bidirectional_iterator;
|
||||
};
|
||||
__can_borrow<_Tp> && !__member_rbegin<_Tp> && !__unqualified_rbegin<_Tp> && requires(_Tp&& __t) {
|
||||
{ ranges::begin(__t) } -> same_as<decltype(ranges::end(__t))>;
|
||||
{ ranges::begin(__t) } -> bidirectional_iterator;
|
||||
};
|
||||
|
||||
struct __fn {
|
||||
template <class _Tp>
|
||||
requires __member_rbegin<_Tp>
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
|
||||
noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.rbegin())))
|
||||
{
|
||||
noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.rbegin()))) {
|
||||
return _LIBCPP_AUTO_CAST(__t.rbegin());
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
requires __unqualified_rbegin<_Tp>
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
|
||||
noexcept(noexcept(_LIBCPP_AUTO_CAST(rbegin(__t))))
|
||||
{
|
||||
noexcept(noexcept(_LIBCPP_AUTO_CAST(rbegin(__t)))) {
|
||||
return _LIBCPP_AUTO_CAST(rbegin(__t));
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
requires __can_reverse<_Tp>
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
|
||||
noexcept(noexcept(ranges::end(__t)))
|
||||
{
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(ranges::end(__t))) {
|
||||
return std::make_reverse_iterator(ranges::end(__t));
|
||||
}
|
||||
|
||||
|
@ -95,7 +81,7 @@ struct __fn {
|
|||
} // namespace __rbegin
|
||||
|
||||
inline namespace __cpo {
|
||||
inline constexpr auto rbegin = __rbegin::__fn{};
|
||||
inline constexpr auto rbegin = __rbegin::__fn{};
|
||||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
|
@ -106,24 +92,24 @@ namespace __crbegin {
|
|||
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::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t))))
|
||||
-> decltype( ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t)))
|
||||
{ return ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t)); }
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
|
||||
noexcept(noexcept(ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t))))
|
||||
-> decltype(ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t))) {
|
||||
return ranges::rbegin(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::rbegin(static_cast<const _Tp&&>(__t))))
|
||||
-> decltype( ranges::rbegin(static_cast<const _Tp&&>(__t)))
|
||||
{ return ranges::rbegin(static_cast<const _Tp&&>(__t)); }
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
|
||||
noexcept(noexcept(ranges::rbegin(static_cast<const _Tp&&>(__t))))
|
||||
-> decltype(ranges::rbegin(static_cast<const _Tp&&>(__t))) {
|
||||
return ranges::rbegin(static_cast<const _Tp&&>(__t));
|
||||
}
|
||||
};
|
||||
} // namespace __crbegin
|
||||
|
||||
inline namespace __cpo {
|
||||
inline constexpr auto crbegin = __crbegin::__fn{};
|
||||
inline constexpr auto crbegin = __crbegin::__fn{};
|
||||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue