mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-25 23:02:27 +00:00
Upgrade to 2022-era LLVM LIBCXX
This commit is contained in:
parent
2f4ca71f26
commit
8e68384e15
2078 changed files with 165657 additions and 65010 deletions
373
third_party/libcxx/__bit_reference
vendored
373
third_party/libcxx/__bit_reference
vendored
|
@ -10,16 +10,25 @@
|
|||
#ifndef _LIBCPP___BIT_REFERENCE
|
||||
#define _LIBCPP___BIT_REFERENCE
|
||||
|
||||
#include "third_party/libcxx/__config"
|
||||
#include "third_party/libcxx/bit"
|
||||
#include "third_party/libcxx/algorithm"
|
||||
#include <__algorithm/copy_n.h>
|
||||
#include <__algorithm/fill_n.h>
|
||||
#include <__algorithm/min.h>
|
||||
#include <__bit/countr.h>
|
||||
#include <__bit/popcount.h>
|
||||
#include <__config>
|
||||
#include <__iterator/iterator_traits.h>
|
||||
#include <__memory/construct_at.h>
|
||||
#include <__memory/pointer_traits.h>
|
||||
#include <__type_traits/conditional.h>
|
||||
#include <__utility/swap.h>
|
||||
#include <cstring>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
#pragma GCC system_header
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include "third_party/libcxx/__undef_macros"
|
||||
#include <__undef_macros>
|
||||
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
@ -47,12 +56,17 @@ class __bit_reference
|
|||
friend class __bit_const_reference<_Cp>;
|
||||
friend class __bit_iterator<_Cp, false>;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
|
||||
using __container = typename _Cp::__self;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
__bit_reference(const __bit_reference&) = default;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 operator bool() const _NOEXCEPT
|
||||
{return static_cast<bool>(*__seg_ & __mask_);}
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator ~() const _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool operator ~() const _NOEXCEPT
|
||||
{return !static_cast<bool>(*this);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
__bit_reference& operator=(bool __x) _NOEXCEPT
|
||||
{
|
||||
if (__x)
|
||||
|
@ -62,16 +76,26 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#if _LIBCPP_STD_VER >= 23
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr const __bit_reference& operator=(bool __x) const noexcept {
|
||||
if (__x)
|
||||
*__seg_ |= __mask_;
|
||||
else
|
||||
*__seg_ &= ~__mask_;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
__bit_reference& operator=(const __bit_reference& __x) _NOEXCEPT
|
||||
{return operator=(static_cast<bool>(__x));}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;}
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, false> operator&() const _NOEXCEPT
|
||||
{return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(__libcpp_ctz(__mask_)));}
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 void flip() _NOEXCEPT {*__seg_ ^= __mask_;}
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator<_Cp, false> operator&() const _NOEXCEPT
|
||||
{return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(std::__libcpp_ctz(__mask_)));}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
explicit __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
|
||||
: __seg_(__s), __mask_(__m) {}
|
||||
};
|
||||
|
||||
|
@ -81,7 +105,7 @@ class __bit_reference<_Cp, false>
|
|||
};
|
||||
|
||||
template <class _Cp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
void
|
||||
swap(__bit_reference<_Cp> __x, __bit_reference<_Cp> __y) _NOEXCEPT
|
||||
{
|
||||
|
@ -91,7 +115,7 @@ swap(__bit_reference<_Cp> __x, __bit_reference<_Cp> __y) _NOEXCEPT
|
|||
}
|
||||
|
||||
template <class _Cp, class _Dp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
void
|
||||
swap(__bit_reference<_Cp> __x, __bit_reference<_Dp> __y) _NOEXCEPT
|
||||
{
|
||||
|
@ -101,7 +125,7 @@ swap(__bit_reference<_Cp> __x, __bit_reference<_Dp> __y) _NOEXCEPT
|
|||
}
|
||||
|
||||
template <class _Cp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
void
|
||||
swap(__bit_reference<_Cp> __x, bool& __y) _NOEXCEPT
|
||||
{
|
||||
|
@ -111,7 +135,7 @@ swap(__bit_reference<_Cp> __x, bool& __y) _NOEXCEPT
|
|||
}
|
||||
|
||||
template <class _Cp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
void
|
||||
swap(bool& __x, __bit_reference<_Cp> __y) _NOEXCEPT
|
||||
{
|
||||
|
@ -132,33 +156,38 @@ class __bit_const_reference
|
|||
friend typename _Cp::__self;
|
||||
friend class __bit_iterator<_Cp, true>;
|
||||
public:
|
||||
using __container = typename _Cp::__self;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_const_reference(const __bit_const_reference&) = default;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
__bit_const_reference(const __bit_reference<_Cp>& __x) _NOEXCEPT
|
||||
: __seg_(__x.__seg_), __mask_(__x.__mask_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR operator bool() const _NOEXCEPT
|
||||
{return static_cast<bool>(*__seg_ & __mask_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, true> operator&() const _NOEXCEPT
|
||||
{return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__libcpp_ctz(__mask_)));}
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator<_Cp, true> operator&() const _NOEXCEPT
|
||||
{return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(std::__libcpp_ctz(__mask_)));}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR
|
||||
__bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
|
||||
explicit __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
|
||||
: __seg_(__s), __mask_(__m) {}
|
||||
|
||||
__bit_const_reference& operator=(const __bit_const_reference& __x);
|
||||
__bit_const_reference& operator=(const __bit_const_reference&) = delete;
|
||||
};
|
||||
|
||||
// find
|
||||
|
||||
template <class _Cp, bool _IsConst>
|
||||
__bit_iterator<_Cp, _IsConst>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, _IsConst>
|
||||
__find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
||||
{
|
||||
typedef __bit_iterator<_Cp, _IsConst> _It;
|
||||
typedef typename _It::__storage_type __storage_type;
|
||||
static const int __bits_per_word = _It::__bits_per_word;
|
||||
const int __bits_per_word = _It::__bits_per_word;
|
||||
// do first partial word
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
|
@ -189,7 +218,7 @@ __find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
|
|||
}
|
||||
|
||||
template <class _Cp, bool _IsConst>
|
||||
__bit_iterator<_Cp, _IsConst>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, _IsConst>
|
||||
__find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
||||
{
|
||||
typedef __bit_iterator<_Cp, _IsConst> _It;
|
||||
|
@ -228,19 +257,19 @@ __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
|
|||
}
|
||||
|
||||
template <class _Cp, bool _IsConst, class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
__bit_iterator<_Cp, _IsConst>
|
||||
find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
|
||||
find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value)
|
||||
{
|
||||
if (static_cast<bool>(__value_))
|
||||
return __find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
||||
return __find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
||||
if (static_cast<bool>(__value))
|
||||
return _VSTD::__find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
||||
return _VSTD::__find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
||||
}
|
||||
|
||||
// count
|
||||
|
||||
template <class _Cp, bool _IsConst>
|
||||
typename __bit_iterator<_Cp, _IsConst>::difference_type
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 typename __bit_iterator<_Cp, _IsConst>::difference_type
|
||||
__count_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
||||
{
|
||||
typedef __bit_iterator<_Cp, _IsConst> _It;
|
||||
|
@ -271,7 +300,7 @@ __count_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
|
|||
}
|
||||
|
||||
template <class _Cp, bool _IsConst>
|
||||
typename __bit_iterator<_Cp, _IsConst>::difference_type
|
||||
_LIBCPP_HIDE_FROM_ABI typename __bit_iterator<_Cp, _IsConst>::difference_type
|
||||
__count_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
||||
{
|
||||
typedef __bit_iterator<_Cp, _IsConst> _It;
|
||||
|
@ -304,17 +333,17 @@ __count_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_typ
|
|||
template <class _Cp, bool _IsConst, class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __bit_iterator<_Cp, _IsConst>::difference_type
|
||||
count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
|
||||
count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value)
|
||||
{
|
||||
if (static_cast<bool>(__value_))
|
||||
return __count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
||||
return __count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
||||
if (static_cast<bool>(__value))
|
||||
return _VSTD::__count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
||||
return _VSTD::__count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
||||
}
|
||||
|
||||
// fill_n
|
||||
|
||||
template <class _Cp>
|
||||
void
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
|
||||
__fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
||||
{
|
||||
typedef __bit_iterator<_Cp, false> _It;
|
||||
|
@ -332,7 +361,7 @@ __fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
|||
}
|
||||
// do middle whole words
|
||||
__storage_type __nw = __n / __bits_per_word;
|
||||
_VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), 0, __nw * sizeof(__storage_type));
|
||||
std::fill_n(std::__to_address(__first.__seg_), __nw, 0);
|
||||
__n -= __nw * __bits_per_word;
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
|
@ -344,7 +373,7 @@ __fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
|||
}
|
||||
|
||||
template <class _Cp>
|
||||
void
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
|
||||
__fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
||||
{
|
||||
typedef __bit_iterator<_Cp, false> _It;
|
||||
|
@ -362,7 +391,8 @@ __fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
|||
}
|
||||
// do middle whole words
|
||||
__storage_type __nw = __n / __bits_per_word;
|
||||
_VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), -1, __nw * sizeof(__storage_type));
|
||||
// __storage_type is always an unsigned type, so -1 sets all bits
|
||||
std::fill_n(std::__to_address(__first.__seg_), __nw, static_cast<__storage_type>(-1));
|
||||
__n -= __nw * __bits_per_word;
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
|
@ -374,33 +404,33 @@ __fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
|||
}
|
||||
|
||||
template <class _Cp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
void
|
||||
fill_n(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n, bool __value_)
|
||||
fill_n(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n, bool __value)
|
||||
{
|
||||
if (__n > 0)
|
||||
{
|
||||
if (__value_)
|
||||
__fill_n_true(__first, __n);
|
||||
if (__value)
|
||||
_VSTD::__fill_n_true(__first, __n);
|
||||
else
|
||||
__fill_n_false(__first, __n);
|
||||
_VSTD::__fill_n_false(__first, __n);
|
||||
}
|
||||
}
|
||||
|
||||
// fill
|
||||
|
||||
template <class _Cp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
void
|
||||
fill(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, bool __value_)
|
||||
fill(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, bool __value)
|
||||
{
|
||||
_VSTD::fill_n(__first, static_cast<typename _Cp::size_type>(__last - __first), __value_);
|
||||
_VSTD::fill_n(__first, static_cast<typename _Cp::size_type>(__last - __first), __value);
|
||||
}
|
||||
|
||||
// copy
|
||||
|
||||
template <class _Cp, bool _IsConst>
|
||||
__bit_iterator<_Cp, false>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false>
|
||||
__copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
|
||||
__bit_iterator<_Cp, false> __result)
|
||||
{
|
||||
|
@ -429,9 +459,7 @@ __copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsCon
|
|||
// __first.__ctz_ == 0;
|
||||
// do middle words
|
||||
__storage_type __nw = __n / __bits_per_word;
|
||||
_VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
|
||||
_VSTD::__to_raw_pointer(__first.__seg_),
|
||||
__nw * sizeof(__storage_type));
|
||||
std::copy_n(std::__to_address(__first.__seg_), __nw, std::__to_address(__result.__seg_));
|
||||
__n -= __nw * __bits_per_word;
|
||||
__result.__seg_ += __nw;
|
||||
// do last word
|
||||
|
@ -449,14 +477,14 @@ __copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsCon
|
|||
}
|
||||
|
||||
template <class _Cp, bool _IsConst>
|
||||
__bit_iterator<_Cp, false>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false>
|
||||
__copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
|
||||
__bit_iterator<_Cp, false> __result)
|
||||
{
|
||||
typedef __bit_iterator<_Cp, _IsConst> _In;
|
||||
typedef typename _In::difference_type difference_type;
|
||||
typedef typename _In::__storage_type __storage_type;
|
||||
static const int __bits_per_word = _In::__bits_per_word;
|
||||
const int __bits_per_word = _In::__bits_per_word;
|
||||
difference_type __n = __last - __first;
|
||||
if (__n > 0)
|
||||
{
|
||||
|
@ -527,19 +555,19 @@ __copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsC
|
|||
}
|
||||
|
||||
template <class _Cp, bool _IsConst>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
__bit_iterator<_Cp, false>
|
||||
copy(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
|
||||
{
|
||||
if (__first.__ctz_ == __result.__ctz_)
|
||||
return __copy_aligned(__first, __last, __result);
|
||||
return __copy_unaligned(__first, __last, __result);
|
||||
return _VSTD::__copy_aligned(__first, __last, __result);
|
||||
return _VSTD::__copy_unaligned(__first, __last, __result);
|
||||
}
|
||||
|
||||
// copy_backward
|
||||
|
||||
template <class _Cp, bool _IsConst>
|
||||
__bit_iterator<_Cp, false>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false>
|
||||
__copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
|
||||
__bit_iterator<_Cp, false> __result)
|
||||
{
|
||||
|
@ -570,9 +598,7 @@ __copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_C
|
|||
__storage_type __nw = __n / __bits_per_word;
|
||||
__result.__seg_ -= __nw;
|
||||
__last.__seg_ -= __nw;
|
||||
_VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
|
||||
_VSTD::__to_raw_pointer(__last.__seg_),
|
||||
__nw * sizeof(__storage_type));
|
||||
std::copy_n(std::__to_address(__last.__seg_), __nw, std::__to_address(__result.__seg_));
|
||||
__n -= __nw * __bits_per_word;
|
||||
// do last word
|
||||
if (__n > 0)
|
||||
|
@ -588,7 +614,7 @@ __copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_C
|
|||
}
|
||||
|
||||
template <class _Cp, bool _IsConst>
|
||||
__bit_iterator<_Cp, false>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false>
|
||||
__copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
|
||||
__bit_iterator<_Cp, false> __result)
|
||||
{
|
||||
|
@ -674,13 +700,13 @@ __copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<
|
|||
}
|
||||
|
||||
template <class _Cp, bool _IsConst>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
__bit_iterator<_Cp, false>
|
||||
copy_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
|
||||
{
|
||||
if (__last.__ctz_ == __result.__ctz_)
|
||||
return __copy_backward_aligned(__first, __last, __result);
|
||||
return __copy_backward_unaligned(__first, __last, __result);
|
||||
return _VSTD::__copy_backward_aligned(__first, __last, __result);
|
||||
return _VSTD::__copy_backward_unaligned(__first, __last, __result);
|
||||
}
|
||||
|
||||
// move
|
||||
|
@ -706,7 +732,7 @@ move_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsCons
|
|||
// swap_ranges
|
||||
|
||||
template <class __C1, class __C2>
|
||||
__bit_iterator<__C2, false>
|
||||
_LIBCPP_HIDE_FROM_ABI __bit_iterator<__C2, false>
|
||||
__swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last,
|
||||
__bit_iterator<__C2, false> __result)
|
||||
{
|
||||
|
@ -756,7 +782,7 @@ __swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1,
|
|||
}
|
||||
|
||||
template <class __C1, class __C2>
|
||||
__bit_iterator<__C2, false>
|
||||
_LIBCPP_HIDE_FROM_ABI __bit_iterator<__C2, false>
|
||||
__swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last,
|
||||
__bit_iterator<__C2, false> __result)
|
||||
{
|
||||
|
@ -862,8 +888,8 @@ swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __
|
|||
__bit_iterator<__C2, false> __first2)
|
||||
{
|
||||
if (__first1.__ctz_ == __first2.__ctz_)
|
||||
return __swap_ranges_aligned(__first1, __last1, __first2);
|
||||
return __swap_ranges_unaligned(__first1, __last1, __first2);
|
||||
return _VSTD::__swap_ranges_aligned(__first1, __last1, __first2);
|
||||
return _VSTD::__swap_ranges_unaligned(__first1, __last1, __first2);
|
||||
}
|
||||
|
||||
// rotate
|
||||
|
@ -881,14 +907,19 @@ struct __bit_array
|
|||
difference_type __size_;
|
||||
__storage_type __word_[_Np];
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY static difference_type capacity()
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 static difference_type capacity()
|
||||
{return static_cast<difference_type>(_Np * __bits_per_word);}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __bit_array(difference_type __s) : __size_(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin()
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bit_array(difference_type __s) : __size_(__s) {
|
||||
if (__libcpp_is_constant_evaluated()) {
|
||||
for (size_t __i = 0; __i != __bit_array<_Cp>::_Np; ++__i)
|
||||
std::__construct_at(__word_ + __i, 0);
|
||||
}
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin()
|
||||
{
|
||||
return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]), 0);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator end()
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end()
|
||||
{
|
||||
return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
|
||||
static_cast<unsigned>(__size_ % __bits_per_word));
|
||||
|
@ -896,7 +927,7 @@ struct __bit_array
|
|||
};
|
||||
|
||||
template <class _Cp>
|
||||
__bit_iterator<_Cp, false>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false>
|
||||
rotate(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __middle, __bit_iterator<_Cp, false> __last)
|
||||
{
|
||||
typedef __bit_iterator<_Cp, false> _I1;
|
||||
|
@ -947,14 +978,14 @@ rotate(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __middle,
|
|||
// equal
|
||||
|
||||
template <class _Cp, bool _IC1, bool _IC2>
|
||||
bool
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
|
||||
__equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1,
|
||||
__bit_iterator<_Cp, _IC2> __first2)
|
||||
{
|
||||
typedef __bit_iterator<_Cp, _IC1> _It;
|
||||
typedef typename _It::difference_type difference_type;
|
||||
typedef typename _It::__storage_type __storage_type;
|
||||
static const int __bits_per_word = _It::__bits_per_word;
|
||||
const int __bits_per_word = _It::__bits_per_word;
|
||||
difference_type __n = __last1 - __first1;
|
||||
if (__n > 0)
|
||||
{
|
||||
|
@ -1029,14 +1060,14 @@ __equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1>
|
|||
}
|
||||
|
||||
template <class _Cp, bool _IC1, bool _IC2>
|
||||
bool
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
|
||||
__equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1,
|
||||
__bit_iterator<_Cp, _IC2> __first2)
|
||||
{
|
||||
typedef __bit_iterator<_Cp, _IC1> _It;
|
||||
typedef typename _It::difference_type difference_type;
|
||||
typedef typename _It::__storage_type __storage_type;
|
||||
static const int __bits_per_word = _It::__bits_per_word;
|
||||
const int __bits_per_word = _It::__bits_per_word;
|
||||
difference_type __n = __last1 - __first1;
|
||||
if (__n > 0)
|
||||
{
|
||||
|
@ -1072,13 +1103,13 @@ __equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __
|
|||
}
|
||||
|
||||
template <class _Cp, bool _IC1, bool _IC2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
bool
|
||||
equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2)
|
||||
{
|
||||
if (__first1.__ctz_ == __first2.__ctz_)
|
||||
return __equal_aligned(__first1, __last1, __first2);
|
||||
return __equal_unaligned(__first1, __last1, __first2);
|
||||
return _VSTD::__equal_aligned(__first1, __last1, __first2);
|
||||
return _VSTD::__equal_unaligned(__first1, __last1, __first2);
|
||||
}
|
||||
|
||||
template <class _Cp, bool _IsConst,
|
||||
|
@ -1089,33 +1120,56 @@ public:
|
|||
typedef typename _Cp::difference_type difference_type;
|
||||
typedef bool value_type;
|
||||
typedef __bit_iterator pointer;
|
||||
typedef typename conditional<_IsConst, __bit_const_reference<_Cp>, __bit_reference<_Cp> >::type reference;
|
||||
#ifndef _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
|
||||
typedef __conditional_t<_IsConst, __bit_const_reference<_Cp>, __bit_reference<_Cp> > reference;
|
||||
#else
|
||||
using reference = __conditional_t<_IsConst, bool, __bit_reference<_Cp> >;
|
||||
#endif
|
||||
typedef random_access_iterator_tag iterator_category;
|
||||
|
||||
private:
|
||||
typedef typename _Cp::__storage_type __storage_type;
|
||||
typedef typename conditional<_IsConst, typename _Cp::__const_storage_pointer,
|
||||
typename _Cp::__storage_pointer>::type __storage_pointer;
|
||||
typedef __conditional_t<_IsConst, typename _Cp::__const_storage_pointer, typename _Cp::__storage_pointer>
|
||||
__storage_pointer;
|
||||
static const unsigned __bits_per_word = _Cp::__bits_per_word;
|
||||
|
||||
__storage_pointer __seg_;
|
||||
unsigned __ctz_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator() _NOEXCEPT
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
: __seg_(nullptr), __ctz_(0)
|
||||
#endif
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
// When _IsConst=false, this is the copy constructor.
|
||||
// It is non-trivial. Making it trivial would break ABI.
|
||||
// When _IsConst=true, this is a converting constructor;
|
||||
// the copy and move constructors are implicitly generated
|
||||
// and trivial.
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
__bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT
|
||||
: __seg_(__it.__seg_), __ctz_(__it.__ctz_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
|
||||
{return reference(__seg_, __storage_type(1) << __ctz_);}
|
||||
// When _IsConst=false, we have a user-provided copy constructor,
|
||||
// so we must also provide a copy assignment operator because
|
||||
// the implicit generation of a defaulted one is deprecated.
|
||||
// When _IsConst=true, the assignment operators are
|
||||
// implicitly generated and trivial.
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
__bit_iterator& operator=(const _If<_IsConst, struct __private_nat, __bit_iterator>& __it) {
|
||||
__seg_ = __it.__seg_;
|
||||
__ctz_ = __it.__ctz_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator& operator++()
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator*() const _NOEXCEPT {
|
||||
return __conditional_t<_IsConst, __bit_const_reference<_Cp>, __bit_reference<_Cp> >(
|
||||
__seg_, __storage_type(1) << __ctz_);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator& operator++()
|
||||
{
|
||||
if (__ctz_ != __bits_per_word-1)
|
||||
++__ctz_;
|
||||
|
@ -1127,14 +1181,14 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator operator++(int)
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator operator++(int)
|
||||
{
|
||||
__bit_iterator __tmp = *this;
|
||||
++(*this);
|
||||
return __tmp;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator& operator--()
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator& operator--()
|
||||
{
|
||||
if (__ctz_ != 0)
|
||||
--__ctz_;
|
||||
|
@ -1146,14 +1200,14 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator operator--(int)
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator operator--(int)
|
||||
{
|
||||
__bit_iterator __tmp = *this;
|
||||
--(*this);
|
||||
return __tmp;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator& operator+=(difference_type __n)
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator& operator+=(difference_type __n)
|
||||
{
|
||||
if (__n >= 0)
|
||||
__seg_ += (__n + __ctz_) / __bits_per_word;
|
||||
|
@ -1165,55 +1219,55 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator& operator-=(difference_type __n)
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator& operator-=(difference_type __n)
|
||||
{
|
||||
return *this += -__n;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator operator+(difference_type __n) const
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator operator+(difference_type __n) const
|
||||
{
|
||||
__bit_iterator __t(*this);
|
||||
__t += __n;
|
||||
return __t;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator operator-(difference_type __n) const
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator operator-(difference_type __n) const
|
||||
{
|
||||
__bit_iterator __t(*this);
|
||||
__t -= __n;
|
||||
return __t;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend __bit_iterator operator+(difference_type __n, const __bit_iterator& __it) {return __it + __n;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend difference_type operator-(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
{return (__x.__seg_ - __y.__seg_) * __bits_per_word + __x.__ctz_ - __y.__ctz_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const {return *(*this + __n);}
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](difference_type __n) const {return *(*this + __n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY friend bool operator==(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 friend bool operator==(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
{return __x.__seg_ == __y.__seg_ && __x.__ctz_ == __y.__ctz_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY friend bool operator!=(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 friend bool operator!=(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
{return !(__x == __y);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY friend bool operator<(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 friend bool operator<(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
{return __x.__seg_ < __y.__seg_ || (__x.__seg_ == __y.__seg_ && __x.__ctz_ < __y.__ctz_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY friend bool operator>(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 friend bool operator>(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
{return __y < __x;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY friend bool operator<=(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 friend bool operator<=(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
{return !(__y < __x);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY friend bool operator>=(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 friend bool operator>=(const __bit_iterator& __x, const __bit_iterator& __y)
|
||||
{return !(__x < __y);}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
explicit __bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT
|
||||
: __seg_(__s), __ctz_(__ctz) {}
|
||||
|
||||
friend typename _Cp::__self;
|
||||
|
@ -1222,26 +1276,44 @@ private:
|
|||
friend class __bit_const_reference<_Cp>;
|
||||
friend class __bit_iterator<_Cp, true>;
|
||||
template <class _Dp> friend struct __bit_array;
|
||||
template <class _Dp> friend void __fill_n_false(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n);
|
||||
template <class _Dp> friend void __fill_n_true(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n);
|
||||
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_aligned(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_unaligned(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> copy(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_backward_aligned(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_backward_unaligned(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> copy_backward(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class _Dp>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend void __fill_n_false(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n);
|
||||
|
||||
template <class _Dp>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend void __fill_n_true(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n);
|
||||
|
||||
template <class _Dp, bool _IC>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend __bit_iterator<_Dp, false> __copy_aligned(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class _Dp, bool _IC>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend __bit_iterator<_Dp, false> __copy_unaligned(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class _Dp, bool _IC>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend __bit_iterator<_Dp, false> copy(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class _Dp, bool _IC>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend __bit_iterator<_Dp, false> __copy_backward_aligned(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class _Dp, bool _IC>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend __bit_iterator<_Dp, false> __copy_backward_unaligned(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class _Dp, bool _IC>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend __bit_iterator<_Dp, false> copy_backward(__bit_iterator<_Dp, _IC> __first,
|
||||
__bit_iterator<_Dp, _IC> __last,
|
||||
__bit_iterator<_Dp, false> __result);
|
||||
template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_aligned(__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C2, false>);
|
||||
|
@ -1251,23 +1323,34 @@ private:
|
|||
template <class __C1, class __C2>friend __bit_iterator<__C2, false> swap_ranges(__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C2, false>);
|
||||
template <class _Dp> friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>,
|
||||
__bit_iterator<_Dp, false>,
|
||||
__bit_iterator<_Dp, false>);
|
||||
template <class _Dp, bool _IC1, bool _IC2> friend bool __equal_aligned(__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC2>);
|
||||
template <class _Dp, bool _IC1, bool _IC2> friend bool __equal_unaligned(__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC2>);
|
||||
template <class _Dp, bool _IC1, bool _IC2> friend bool equal(__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC2>);
|
||||
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, _IC> __find_bool_true(__bit_iterator<_Dp, _IC>,
|
||||
typename _Dp::size_type);
|
||||
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, _IC> __find_bool_false(__bit_iterator<_Dp, _IC>,
|
||||
typename _Dp::size_type);
|
||||
template <class _Dp>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>,
|
||||
__bit_iterator<_Dp, false>,
|
||||
__bit_iterator<_Dp, false>);
|
||||
template <class _Dp, bool _IC1, bool _IC2>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend bool __equal_aligned(__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC2>);
|
||||
template <class _Dp, bool _IC1, bool _IC2>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend bool __equal_unaligned(__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC2>);
|
||||
template <class _Dp, bool _IC1, bool _IC2>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend bool equal(__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC1>,
|
||||
__bit_iterator<_Dp, _IC2>);
|
||||
template <class _Dp, bool _IC>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend __bit_iterator<_Dp, _IC> __find_bool_true(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
|
||||
template <class _Dp, bool _IC>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
friend __bit_iterator<_Dp, _IC> __find_bool_false(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
|
||||
template <class _Dp, bool _IC> friend typename __bit_iterator<_Dp, _IC>::difference_type
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
|
||||
__count_bool_true(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
|
||||
template <class _Dp, bool _IC> friend typename __bit_iterator<_Dp, _IC>::difference_type
|
||||
__count_bool_false(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
|
||||
|
@ -1277,4 +1360,4 @@ _LIBCPP_END_NAMESPACE_STD
|
|||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
||||
#endif // _LIBCPP___BIT_REFERENCE
|
||||
#endif // _LIBCPP___BIT_REFERENCE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue