mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +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
60
third_party/libcxx/__ranges/counted.h
vendored
60
third_party/libcxx/__ranges/counted.h
vendored
|
@ -29,6 +29,9 @@
|
|||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if _LIBCPP_STD_VER >= 20
|
||||
|
@ -37,41 +40,42 @@ namespace ranges::views {
|
|||
|
||||
namespace __counted {
|
||||
|
||||
struct __fn {
|
||||
template<contiguous_iterator _It>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static constexpr auto __go(_It __it, iter_difference_t<_It> __count)
|
||||
noexcept(noexcept(span(std::to_address(__it), static_cast<size_t>(__count))))
|
||||
// Deliberately omit return-type SFINAE, because to_address is not SFINAE-friendly
|
||||
{ return span(std::to_address(__it), static_cast<size_t>(__count)); }
|
||||
struct __fn {
|
||||
template <contiguous_iterator _It>
|
||||
_LIBCPP_HIDE_FROM_ABI static constexpr auto
|
||||
__go(_It __it,
|
||||
iter_difference_t<_It> __count) noexcept(noexcept(span(std::to_address(__it), static_cast<size_t>(__count))))
|
||||
// Deliberately omit return-type SFINAE, because to_address is not SFINAE-friendly
|
||||
{
|
||||
return span(std::to_address(__it), static_cast<size_t>(__count));
|
||||
}
|
||||
|
||||
template<random_access_iterator _It>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static constexpr auto __go(_It __it, iter_difference_t<_It> __count)
|
||||
noexcept(noexcept(subrange(__it, __it + __count)))
|
||||
-> decltype( subrange(__it, __it + __count))
|
||||
{ return subrange(__it, __it + __count); }
|
||||
template <random_access_iterator _It>
|
||||
_LIBCPP_HIDE_FROM_ABI static constexpr auto __go(_It __it, iter_difference_t<_It> __count) noexcept(
|
||||
noexcept(subrange(__it, __it + __count))) -> decltype(subrange(__it, __it + __count)) {
|
||||
return subrange(__it, __it + __count);
|
||||
}
|
||||
|
||||
template<class _It>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static constexpr auto __go(_It __it, iter_difference_t<_It> __count)
|
||||
noexcept(noexcept(subrange(counted_iterator(std::move(__it), __count), default_sentinel)))
|
||||
-> decltype( subrange(counted_iterator(std::move(__it), __count), default_sentinel))
|
||||
{ return subrange(counted_iterator(std::move(__it), __count), default_sentinel); }
|
||||
template <class _It>
|
||||
_LIBCPP_HIDE_FROM_ABI static constexpr auto __go(_It __it, iter_difference_t<_It> __count) noexcept(
|
||||
noexcept(subrange(counted_iterator(std::move(__it), __count), default_sentinel)))
|
||||
-> decltype(subrange(counted_iterator(std::move(__it), __count), default_sentinel)) {
|
||||
return subrange(counted_iterator(std::move(__it), __count), default_sentinel);
|
||||
}
|
||||
|
||||
template<class _It, convertible_to<iter_difference_t<_It>> _Diff>
|
||||
requires input_or_output_iterator<decay_t<_It>>
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI
|
||||
constexpr auto operator()(_It&& __it, _Diff&& __count) const
|
||||
template <class _It, convertible_to<iter_difference_t<_It>> _Diff>
|
||||
requires input_or_output_iterator<decay_t<_It>>
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_It&& __it, _Diff&& __count) const
|
||||
noexcept(noexcept(__go(std::forward<_It>(__it), std::forward<_Diff>(__count))))
|
||||
-> decltype( __go(std::forward<_It>(__it), std::forward<_Diff>(__count)))
|
||||
{ return __go(std::forward<_It>(__it), std::forward<_Diff>(__count)); }
|
||||
};
|
||||
-> decltype(__go(std::forward<_It>(__it), std::forward<_Diff>(__count))) {
|
||||
return __go(std::forward<_It>(__it), std::forward<_Diff>(__count));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace __counted
|
||||
|
||||
inline namespace __cpo {
|
||||
inline constexpr auto counted = __counted::__fn{};
|
||||
inline constexpr auto counted = __counted::__fn{};
|
||||
} // namespace __cpo
|
||||
|
||||
} // namespace ranges::views
|
||||
|
@ -80,4 +84,6 @@ inline namespace __cpo {
|
|||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
||||
#endif // _LIBCPP___RANGES_COUNTED_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue