aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/bitset
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/libcxx/include/bitset')
-rw-r--r--contrib/llvm-project/libcxx/include/bitset237
1 files changed, 136 insertions, 101 deletions
diff --git a/contrib/llvm-project/libcxx/include/bitset b/contrib/llvm-project/libcxx/include/bitset
index c63ee22b1dfe..d33015dc6b87 100644
--- a/contrib/llvm-project/libcxx/include/bitset
+++ b/contrib/llvm-project/libcxx/include/bitset
@@ -10,6 +10,8 @@
#ifndef _LIBCPP_BITSET
#define _LIBCPP_BITSET
+// clang-format off
+
/*
bitset synopsis
@@ -40,15 +42,25 @@ public:
constexpr bitset() noexcept;
constexpr bitset(unsigned long long val) noexcept;
template <class charT>
- explicit bitset(const charT* str,
- typename basic_string<charT>::size_type n = basic_string<charT>::npos,
- charT zero = charT('0'), charT one = charT('1')); // constexpr since C++23
+ constexpr explicit bitset(const charT* str,
+ typename basic_string<charT>::size_type n = basic_string<charT>::npos,
+ charT zero = charT('0'), charT one = charT('1')); // until C++26, constexpr since C++23
+ template <class charT>
+ constexpr explicit bitset(const charT* str,
+ typename basic_string_view<charT>::size_type n = basic_string_view<charT>::npos,
+ charT zero = charT('0'), charT one = charT('1')); // since C++26
+ template<class charT, class traits>
+ explicit bitset(
+ const basic_string_view<charT,traits>& str,
+ typename basic_string_view<charT,traits>::size_type pos = 0,
+ typename basic_string_view<charT,traits>::size_type n = basic_string_view<charT,traits>::npos,
+ charT zero = charT('0'), charT one = charT('1')); // since C++26
template<class charT, class traits, class Allocator>
- explicit bitset(const basic_string<charT,traits,Allocator>& str,
- typename basic_string<charT,traits,Allocator>::size_type pos = 0,
- typename basic_string<charT,traits,Allocator>::size_type n =
- basic_string<charT,traits,Allocator>::npos,
- charT zero = charT('0'), charT one = charT('1')); // constexpr since C++23
+ constexpr explicit bitset(
+ const basic_string<charT,traits,Allocator>& str,
+ typename basic_string<charT,traits,Allocator>::size_type pos = 0,
+ typename basic_string<charT,traits,Allocator>::size_type n = basic_string<charT,traits,Allocator>::npos,
+ charT zero = charT('0'), charT one = charT('1')); // constexpr since C++23
// 23.3.5.2 bitset operations:
bitset& operator&=(const bitset& rhs) noexcept; // constexpr since C++23
@@ -112,7 +124,11 @@ template <size_t N> struct hash<std::bitset<N>>;
*/
+// clang-format on
+
+#include <__algorithm/count.h>
#include <__algorithm/fill.h>
+#include <__algorithm/find.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__bit_reference>
#include <__config>
@@ -176,52 +192,52 @@ protected:
typedef __bit_iterator<__bitset, false> iterator;
typedef __bit_iterator<__bitset, true> const_iterator;
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
_LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 reference __make_ref(size_t __pos) _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 reference __make_ref(size_t __pos) _NOEXCEPT
{return reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
{return const_reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 iterator __make_iter(size_t __pos) _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 iterator __make_iter(size_t __pos) _NOEXCEPT
{return iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 const_iterator __make_iter(size_t __pos) const _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 const_iterator __make_iter(size_t __pos) const _NOEXCEPT
{return const_iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
void operator&=(const __bitset& __v) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
void operator|=(const __bitset& __v) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
void operator^=(const __bitset& __v) _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void flip() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong() const
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong() const
{return to_ulong(integral_constant<bool, _Size < sizeof(unsigned long) * CHAR_BIT>());}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong() const
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong() const
{return to_ullong(integral_constant<bool, _Size < sizeof(unsigned long long) * CHAR_BIT>());}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool all() const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool any() const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t __hash_code() const _NOEXCEPT;
private:
#ifdef _LIBCPP_CXX03_LANG
void __init(unsigned long long __v, false_type) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
void __init(unsigned long long __v, true_type) _NOEXCEPT;
#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
unsigned long to_ulong(false_type) const;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
unsigned long to_ulong(true_type) const;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
unsigned long long to_ullong(false_type) const;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
unsigned long long to_ullong(true_type) const;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
unsigned long long to_ullong(true_type, false_type) const;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
unsigned long long to_ullong(true_type, true_type) const;
@@ -236,7 +252,7 @@ __bitset<_N_words, _Size>::__bitset() _NOEXCEPT
#endif
{
#ifdef _LIBCPP_CXX03_LANG
- _VSTD::fill_n(__first_, _N_words, __storage_type(0));
+ std::fill_n(__first_, _N_words, __storage_type(0));
#endif
}
@@ -254,13 +270,13 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, false_type) _NOEXCEPT
else
__t[__i] = static_cast<__storage_type>(__v);
- _VSTD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
- _VSTD::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + sizeof(__first_)/sizeof(__first_[0]),
+ std::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
+ std::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + sizeof(__first_)/sizeof(__first_[0]),
__storage_type(0));
}
template <size_t _N_words, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
void
__bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT
{
@@ -268,7 +284,7 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT
if (_Size < __bits_per_word)
__first_[0] &= ( 1ULL << _Size ) - 1;
- _VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
+ std::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
}
#endif // _LIBCPP_CXX03_LANG
@@ -345,7 +361,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long
__bitset<_N_words, _Size>::to_ulong(false_type) const
{
const_iterator __e = __make_iter(_Size);
- const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
+ const_iterator __i = std::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
if (__i != __e)
__throw_overflow_error("bitset to_ulong overflow error");
@@ -365,7 +381,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long
__bitset<_N_words, _Size>::to_ullong(false_type) const
{
const_iterator __e = __make_iter(_Size);
- const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
+ const_iterator __i = std::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
if (__i != __e)
__throw_overflow_error("bitset to_ullong overflow error");
@@ -475,41 +491,41 @@ protected:
typedef __bit_iterator<__bitset, false> iterator;
typedef __bit_iterator<__bitset, true> const_iterator;
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
_LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 reference __make_ref(size_t __pos) _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 reference __make_ref(size_t __pos) _NOEXCEPT
{return reference(&__first_, __storage_type(1) << __pos);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
{return const_reference(&__first_, __storage_type(1) << __pos);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 iterator __make_iter(size_t __pos) _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 iterator __make_iter(size_t __pos) _NOEXCEPT
{return iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 const_iterator __make_iter(size_t __pos) const _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 const_iterator __make_iter(size_t __pos) const _NOEXCEPT
{return const_iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
void operator&=(const __bitset& __v) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
void operator|=(const __bitset& __v) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
void operator^=(const __bitset& __v) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
void flip() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
unsigned long to_ulong() const;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
unsigned long long to_ullong() const;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bool all() const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bool any() const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t __hash_code() const _NOEXCEPT;
};
@@ -632,33 +648,33 @@ protected:
typedef __bit_iterator<__bitset, false> iterator;
typedef __bit_iterator<__bitset, true> const_iterator;
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
_LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 reference __make_ref(size_t) _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 reference __make_ref(size_t) _NOEXCEPT
{return reference(nullptr, 1);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t) const _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference __make_ref(size_t) const _NOEXCEPT
{return const_reference(nullptr, 1);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 iterator __make_iter(size_t) _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 iterator __make_iter(size_t) _NOEXCEPT
{return iterator(nullptr, 0);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 const_iterator __make_iter(size_t) const _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 const_iterator __make_iter(size_t) const _NOEXCEPT
{return const_iterator(nullptr, 0);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator&=(const __bitset&) _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator|=(const __bitset&) _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator^=(const __bitset&) _NOEXCEPT {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator&=(const __bitset&) _NOEXCEPT {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator|=(const __bitset&) _NOEXCEPT {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator^=(const __bitset&) _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void flip() _NOEXCEPT {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void flip() _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong() const {return 0;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong() const {return 0;}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong() const {return 0;}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong() const {return 0;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bool all() const _NOEXCEPT {return true;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bool any() const _NOEXCEPT {return false;}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool all() const _NOEXCEPT {return true;}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool any() const _NOEXCEPT {return false;}
- _LIBCPP_INLINE_VISIBILITY size_t __hash_code() const _NOEXCEPT {return 0;}
+ _LIBCPP_HIDE_FROM_ABI size_t __hash_code() const _NOEXCEPT {return 0;}
};
inline
@@ -689,19 +705,38 @@ public:
typedef typename base::const_reference const_reference;
// 23.3.5.1 constructors:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bitset() _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bitset() _NOEXCEPT {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
bitset(unsigned long long __v) _NOEXCEPT : base(__v) {}
template <class _CharT, class = __enable_if_t<_IsCharLikeType<_CharT>::value> >
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit bitset(
const _CharT* __str,
+# if _LIBCPP_STD_VER >= 26
+ typename basic_string_view<_CharT>::size_type __n = basic_string_view<_CharT>::npos,
+# else
typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos,
- _CharT __zero = _CharT('0'),
- _CharT __one = _CharT('1')) {
+# endif
+ _CharT __zero = _CharT('0'),
+ _CharT __one = _CharT('1')) {
size_t __rlen = std::min(__n, char_traits<_CharT>::length(__str));
__init_from_string_view(basic_string_view<_CharT>(__str, __rlen), __zero, __one);
}
+#if _LIBCPP_STD_VER >= 26
+ template <class _CharT, class _Traits>
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit bitset(
+ basic_string_view<_CharT, _Traits> __str,
+ typename basic_string_view<_CharT, _Traits>::size_type __pos = 0,
+ typename basic_string_view<_CharT, _Traits>::size_type __n = basic_string_view<_CharT, _Traits>::npos,
+ _CharT __zero = _CharT('0'),
+ _CharT __one = _CharT('1')) {
+ if (__pos > __str.size())
+ __throw_out_of_range("bitset string pos out of range");
+
+ size_t __rlen = std::min(__n, __str.size() - __pos);
+ __init_from_string_view(basic_string_view<_CharT, _Traits>(__str.data() + __pos, __rlen), __zero, __one);
+ }
+#endif
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit bitset(
const basic_string<_CharT, _Traits, _Allocator>& __str,
@@ -718,27 +753,27 @@ public:
}
// 23.3.5.2 bitset operations:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset& operator&=(const bitset& __rhs) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset& operator|=(const bitset& __rhs) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset& operator^=(const bitset& __rhs) _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset& operator<<=(size_t __pos) _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset& operator>>=(size_t __pos) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset& set() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset& set(size_t __pos, bool __val = true);
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset& reset() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset& reset(size_t __pos);
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset operator~() const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset& flip() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset& flip(size_t __pos);
@@ -750,44 +785,44 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference operator[](size_t __p) const {return base::__make_ref(__p);}
#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 reference operator[](size_t __p) {return base::__make_ref(__p);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
unsigned long to_ulong() const;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
unsigned long long to_ullong() const;
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
basic_string<_CharT, _Traits, _Allocator> to_string(_CharT __zero = _CharT('0'),
_CharT __one = _CharT('1')) const;
template <class _CharT, class _Traits>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
basic_string<_CharT, _Traits, allocator<_CharT> > to_string(_CharT __zero = _CharT('0'),
_CharT __one = _CharT('1')) const;
template <class _CharT>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > to_string(_CharT __zero = _CharT('0'),
_CharT __one = _CharT('1')) const;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
basic_string<char, char_traits<char>, allocator<char> > to_string(char __zero = '0',
char __one = '1') const;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
size_t count() const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT {return _Size;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT {return _Size;}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bool operator==(const bitset& __rhs) const _NOEXCEPT;
#if _LIBCPP_STD_VER <= 17
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
bool operator!=(const bitset& __rhs) const _NOEXCEPT;
#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bool test(size_t __pos) const;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bool all() const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bool any() const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bool none() const _NOEXCEPT {return !any();}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool none() const _NOEXCEPT {return !any();}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset operator<<(size_t __pos) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset operator>>(size_t __pos) const _NOEXCEPT;
private:
@@ -808,7 +843,7 @@ private:
std::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t __hash_code() const _NOEXCEPT {return base::__hash_code();}
friend struct hash<bitset>;
@@ -849,9 +884,9 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset<_Size>&
bitset<_Size>::operator<<=(size_t __pos) _NOEXCEPT
{
- __pos = _VSTD::min(__pos, _Size);
- _VSTD::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
- _VSTD::fill_n(base::__make_iter(0), __pos, false);
+ __pos = std::min(__pos, _Size);
+ std::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
+ std::fill_n(base::__make_iter(0), __pos, false);
return *this;
}
@@ -860,9 +895,9 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset<_Size>&
bitset<_Size>::operator>>=(size_t __pos) _NOEXCEPT
{
- __pos = _VSTD::min(__pos, _Size);
- _VSTD::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
- _VSTD::fill_n(base::__make_iter(_Size - __pos), __pos, false);
+ __pos = std::min(__pos, _Size);
+ std::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
+ std::fill_n(base::__make_iter(_Size - __pos), __pos, false);
return *this;
}
@@ -872,7 +907,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset<_Size>&
bitset<_Size>::set() _NOEXCEPT
{
- _VSTD::fill_n(base::__make_iter(0), _Size, true);
+ std::fill_n(base::__make_iter(0), _Size, true);
return *this;
}
@@ -894,7 +929,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset<_Size>&
bitset<_Size>::reset() _NOEXCEPT
{
- _VSTD::fill_n(base::__make_iter(0), _Size, false);
+ std::fill_n(base::__make_iter(0), _Size, false);
return *this;
}
@@ -1012,7 +1047,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
size_t
bitset<_Size>::count() const _NOEXCEPT
{
- return static_cast<size_t>(_VSTD::__count_bool_true(base::__make_iter(0), _Size));
+ return static_cast<size_t>(std::count(base::__make_iter(0), base::__make_iter(_Size), true));
}
template <size_t _Size>
@@ -1021,7 +1056,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bool
bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT
{
- return _VSTD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
+ return std::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
}
#if _LIBCPP_STD_VER <= 17
@@ -1089,7 +1124,7 @@ bitset<_Size>::operator>>(size_t __pos) const _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset<_Size>
operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
{
@@ -1099,7 +1134,7 @@ operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset<_Size>
operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
{
@@ -1109,7 +1144,7 @@ operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset<_Size>
operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
{
@@ -1122,7 +1157,7 @@ template <size_t _Size>
struct _LIBCPP_TEMPLATE_VIS hash<bitset<_Size> >
: public __unary_function<bitset<_Size>, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(const bitset<_Size>& __bs) const _NOEXCEPT
{return __bs.__hash_code();}
};