mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08: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
97
third_party/libcxx/__ranges/owning_view.h
vendored
97
third_party/libcxx/__ranges/owning_view.h
vendored
|
@ -27,52 +27,83 @@
|
|||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if _LIBCPP_STD_VER >= 20
|
||||
|
||||
namespace ranges {
|
||||
template<range _Rp>
|
||||
requires movable<_Rp> && (!__is_std_initializer_list<remove_cvref_t<_Rp>>)
|
||||
class owning_view : public view_interface<owning_view<_Rp>> {
|
||||
_Rp __r_ = _Rp();
|
||||
template <range _Rp>
|
||||
requires movable<_Rp> && (!__is_std_initializer_list<remove_cvref_t<_Rp>>)
|
||||
class owning_view : public view_interface<owning_view<_Rp>> {
|
||||
_Rp __r_ = _Rp();
|
||||
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI owning_view() requires default_initializable<_Rp> = default;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr owning_view(_Rp&& __r) : __r_(std::move(__r)) {}
|
||||
_LIBCPP_HIDE_FROM_ABI owning_view()
|
||||
requires default_initializable<_Rp>
|
||||
= default;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr owning_view(_Rp&& __r) : __r_(std::move(__r)) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI owning_view(owning_view&&) = default;
|
||||
_LIBCPP_HIDE_FROM_ABI owning_view& operator=(owning_view&&) = default;
|
||||
_LIBCPP_HIDE_FROM_ABI owning_view(owning_view&&) = default;
|
||||
_LIBCPP_HIDE_FROM_ABI owning_view& operator=(owning_view&&) = default;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr _Rp& base() & noexcept { return __r_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr const _Rp& base() const& noexcept { return __r_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr _Rp&& base() && noexcept { return std::move(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr const _Rp&& base() const&& noexcept { return std::move(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr _Rp& base() & noexcept { return __r_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr const _Rp& base() const& noexcept { return __r_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr _Rp&& base() && noexcept { return std::move(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr const _Rp&& base() const&& noexcept { return std::move(__r_); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Rp> begin() { return ranges::begin(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Rp> end() { return ranges::end(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto begin() const requires range<const _Rp> { return ranges::begin(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto end() const requires range<const _Rp> { return ranges::end(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Rp> begin() { return ranges::begin(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Rp> end() { return ranges::end(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
|
||||
requires range<const _Rp>
|
||||
{
|
||||
return ranges::begin(__r_);
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto end() const
|
||||
requires range<const _Rp>
|
||||
{
|
||||
return ranges::end(__r_);
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool empty() requires requires { ranges::empty(__r_); }
|
||||
{ return ranges::empty(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool empty() const requires requires { ranges::empty(__r_); }
|
||||
{ return ranges::empty(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool empty()
|
||||
requires requires { ranges::empty(__r_); }
|
||||
{
|
||||
return ranges::empty(__r_);
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool empty() const
|
||||
requires requires { ranges::empty(__r_); }
|
||||
{
|
||||
return ranges::empty(__r_);
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto size() requires sized_range<_Rp>
|
||||
{ return ranges::size(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto size() const requires sized_range<const _Rp>
|
||||
{ return ranges::size(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto size()
|
||||
requires sized_range<_Rp>
|
||||
{
|
||||
return ranges::size(__r_);
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto size() const
|
||||
requires sized_range<const _Rp>
|
||||
{
|
||||
return ranges::size(__r_);
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto data() requires contiguous_range<_Rp>
|
||||
{ return ranges::data(__r_); }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto data() const requires contiguous_range<const _Rp>
|
||||
{ return ranges::data(__r_); }
|
||||
};
|
||||
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(owning_view);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto data()
|
||||
requires contiguous_range<_Rp>
|
||||
{
|
||||
return ranges::data(__r_);
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto data() const
|
||||
requires contiguous_range<const _Rp>
|
||||
{
|
||||
return ranges::data(__r_);
|
||||
}
|
||||
};
|
||||
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(owning_view);
|
||||
|
||||
template<class _Tp>
|
||||
inline constexpr bool enable_borrowed_range<owning_view<_Tp>> = enable_borrowed_range<_Tp>;
|
||||
template <class _Tp>
|
||||
inline constexpr bool enable_borrowed_range<owning_view<_Tp>> = enable_borrowed_range<_Tp>;
|
||||
|
||||
} // namespace ranges
|
||||
|
||||
|
@ -80,4 +111,6 @@ public:
|
|||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
||||
#endif // _LIBCPP___RANGES_OWNING_VIEW_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue