diff options
Diffstat (limited to 'libcxx/include/bitset')
| -rw-r--r-- | libcxx/include/bitset | 281 |
1 files changed, 164 insertions, 117 deletions
diff --git a/libcxx/include/bitset b/libcxx/include/bitset index 0f997cef8316..c260f9f592c0 100644 --- a/libcxx/include/bitset +++ b/libcxx/include/bitset @@ -42,61 +42,61 @@ public: 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')); + charT zero = charT('0'), charT one = charT('1')); // constexpr since C++23 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')); + charT zero = charT('0'), charT one = charT('1')); // constexpr since C++23 // 23.3.5.2 bitset operations: - bitset& operator&=(const bitset& rhs) noexcept; - bitset& operator|=(const bitset& rhs) noexcept; - bitset& operator^=(const bitset& rhs) noexcept; - bitset& operator<<=(size_t pos) noexcept; - bitset& operator>>=(size_t pos) noexcept; - bitset& set() noexcept; - bitset& set(size_t pos, bool val = true); - bitset& reset() noexcept; - bitset& reset(size_t pos); - bitset operator~() const noexcept; - bitset& flip() noexcept; - bitset& flip(size_t pos); + bitset& operator&=(const bitset& rhs) noexcept; // constexpr since C++23 + bitset& operator|=(const bitset& rhs) noexcept; // constexpr since C++23 + bitset& operator^=(const bitset& rhs) noexcept; // constexpr since C++23 + bitset& operator<<=(size_t pos) noexcept; // constexpr since C++23 + bitset& operator>>=(size_t pos) noexcept; // constexpr since C++23 + bitset& set() noexcept; // constexpr since C++23 + bitset& set(size_t pos, bool val = true); // constexpr since C++23 + bitset& reset() noexcept; // constexpr since C++23 + bitset& reset(size_t pos); // constexpr since C++23 + bitset operator~() const noexcept; // constexpr since C++23 + bitset& flip() noexcept; // constexpr since C++23 + bitset& flip(size_t pos); // constexpr since C++23 // element access: - constexpr bool operator[](size_t pos) const; // for b[i]; - reference operator[](size_t pos); // for b[i]; - unsigned long to_ulong() const; - unsigned long long to_ullong() const; - template <class charT, class traits, class Allocator> + constexpr bool operator[](size_t pos) const; + reference operator[](size_t pos); // constexpr since C++23 + unsigned long to_ulong() const; // constexpr since C++23 + unsigned long long to_ullong() const; // constexpr since C++23 + template <class charT, class traits, class Allocator> // constexpr since C++23 basic_string<charT, traits, Allocator> to_string(charT zero = charT('0'), charT one = charT('1')) const; - template <class charT, class traits> + template <class charT, class traits> // constexpr since C++23 basic_string<charT, traits, allocator<charT> > to_string(charT zero = charT('0'), charT one = charT('1')) const; - template <class charT> + template <class charT> // constexpr since C++23 basic_string<charT, char_traits<charT>, allocator<charT> > to_string(charT zero = charT('0'), charT one = charT('1')) const; - basic_string<char, char_traits<char>, allocator<char> > to_string(char zero = '0', char one = '1') const; - size_t count() const noexcept; - constexpr size_t size() const noexcept; - bool operator==(const bitset& rhs) const noexcept; - bool operator!=(const bitset& rhs) const noexcept; - bool test(size_t pos) const; - bool all() const noexcept; - bool any() const noexcept; - bool none() const noexcept; - bitset operator<<(size_t pos) const noexcept; - bitset operator>>(size_t pos) const noexcept; + basic_string<char, char_traits<char>, allocator<char> > to_string(char zero = '0', char one = '1') const; // constexpr since C++23 + size_t count() const noexcept; // constexpr since C++23 + constexpr size_t size() const noexcept; // constexpr since C++23 + bool operator==(const bitset& rhs) const noexcept; // constexpr since C++23 + bool operator!=(const bitset& rhs) const noexcept; // constexpr since C++23 + bool test(size_t pos) const; // constexpr since C++23 + bool all() const noexcept; // constexpr since C++23 + bool any() const noexcept; // constexpr since C++23 + bool none() const noexcept; // constexpr since C++23 + bitset<N> operator<<(size_t pos) const noexcept; // constexpr since C++23 + bitset<N> operator>>(size_t pos) const noexcept; // constexpr since C++23 }; // 23.3.5.3 bitset operators: template <size_t N> -bitset<N> operator&(const bitset<N>&, const bitset<N>&) noexcept; +bitset<N> operator&(const bitset<N>&, const bitset<N>&) noexcept; // constexpr since C++23 template <size_t N> -bitset<N> operator|(const bitset<N>&, const bitset<N>&) noexcept; +bitset<N> operator|(const bitset<N>&, const bitset<N>&) noexcept; // constexpr since C++23 template <size_t N> -bitset<N> operator^(const bitset<N>&, const bitset<N>&) noexcept; +bitset<N> operator^(const bitset<N>&, const bitset<N>&) noexcept; // constexpr since C++23 template <class charT, class traits, size_t N> basic_istream<charT, traits>& @@ -118,12 +118,15 @@ template <size_t N> struct hash<std::bitset<N>>; #include <__config> #include <__functional/hash.h> #include <__functional/unary_function.h> +#include <__type_traits/is_char_like_type.h> #include <climits> #include <cstddef> #include <stdexcept> #include <version> // standard-mandated includes + +// [bitset.syn] #include <iosfwd> #include <string> @@ -177,30 +180,30 @@ protected: _LIBCPP_INLINE_VISIBILITY explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY _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 {return const_reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);} - _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY _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 const_iterator __make_iter(size_t __pos) const _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY _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_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator&=(const __bitset& __v) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator|=(const __bitset& __v) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator^=(const __bitset& __v) _NOEXCEPT; - void flip() _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY unsigned long to_ulong() const + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void flip() _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong() const {return to_ulong(integral_constant<bool, _Size < sizeof(unsigned long) * CHAR_BIT>());} - _LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong() const {return to_ullong(integral_constant<bool, _Size < sizeof(unsigned long long) * CHAR_BIT>());} - bool all() const _NOEXCEPT; - bool any() const _NOEXCEPT; + _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 size_t __hash_code() const _NOEXCEPT; private: @@ -209,14 +212,17 @@ private: _LIBCPP_INLINE_VISIBILITY 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_INLINE_VISIBILITY _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_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong(true_type) const; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _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; }; @@ -289,7 +295,7 @@ __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT template <size_t _N_words, size_t _Size> inline -void +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void __bitset<_N_words, _Size>::operator&=(const __bitset& __v) _NOEXCEPT { for (size_type __i = 0; __i < _N_words; ++__i) @@ -298,7 +304,7 @@ __bitset<_N_words, _Size>::operator&=(const __bitset& __v) _NOEXCEPT template <size_t _N_words, size_t _Size> inline -void +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void __bitset<_N_words, _Size>::operator|=(const __bitset& __v) _NOEXCEPT { for (size_type __i = 0; __i < _N_words; ++__i) @@ -307,7 +313,7 @@ __bitset<_N_words, _Size>::operator|=(const __bitset& __v) _NOEXCEPT template <size_t _N_words, size_t _Size> inline -void +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void __bitset<_N_words, _Size>::operator^=(const __bitset& __v) _NOEXCEPT { for (size_type __i = 0; __i < _N_words; ++__i) @@ -315,7 +321,7 @@ __bitset<_N_words, _Size>::operator^=(const __bitset& __v) _NOEXCEPT } template <size_t _N_words, size_t _Size> -void +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void __bitset<_N_words, _Size>::flip() _NOEXCEPT { // do middle whole words @@ -334,7 +340,7 @@ __bitset<_N_words, _Size>::flip() _NOEXCEPT } template <size_t _N_words, size_t _Size> -unsigned long +_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); @@ -347,14 +353,14 @@ __bitset<_N_words, _Size>::to_ulong(false_type) const template <size_t _N_words, size_t _Size> inline -unsigned long +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long __bitset<_N_words, _Size>::to_ulong(true_type) const { return __first_[0]; } template <size_t _N_words, size_t _Size> -unsigned long long +_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); @@ -367,7 +373,7 @@ __bitset<_N_words, _Size>::to_ullong(false_type) const template <size_t _N_words, size_t _Size> inline -unsigned long long +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long __bitset<_N_words, _Size>::to_ullong(true_type) const { return to_ullong(true_type(), integral_constant<bool, sizeof(__storage_type) < sizeof(unsigned long long)>()); @@ -375,14 +381,14 @@ __bitset<_N_words, _Size>::to_ullong(true_type) const template <size_t _N_words, size_t _Size> inline -unsigned long long +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long __bitset<_N_words, _Size>::to_ullong(true_type, false_type) const { return __first_[0]; } template <size_t _N_words, size_t _Size> -unsigned long long +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long __bitset<_N_words, _Size>::to_ullong(true_type, true_type) const { unsigned long long __r = __first_[0]; @@ -392,7 +398,7 @@ __bitset<_N_words, _Size>::to_ullong(true_type, true_type) const } template <size_t _N_words, size_t _Size> -bool +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool __bitset<_N_words, _Size>::all() const _NOEXCEPT { // do middle whole words @@ -412,7 +418,7 @@ __bitset<_N_words, _Size>::all() const _NOEXCEPT } template <size_t _N_words, size_t _Size> -bool +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool __bitset<_N_words, _Size>::any() const _NOEXCEPT { // do middle whole words @@ -473,33 +479,33 @@ protected: _LIBCPP_INLINE_VISIBILITY explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY _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 {return const_reference(&__first_, __storage_type(1) << __pos);} - _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY _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 const_iterator __make_iter(size_t __pos) const _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY _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_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator&=(const __bitset& __v) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator|=(const __bitset& __v) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator^=(const __bitset& __v) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void flip() _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong() const; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong() const; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bool all() const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bool any() const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY @@ -527,7 +533,7 @@ __bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT template <size_t _Size> inline -void +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void __bitset<1, _Size>::operator&=(const __bitset& __v) _NOEXCEPT { __first_ &= __v.__first_; @@ -535,7 +541,7 @@ __bitset<1, _Size>::operator&=(const __bitset& __v) _NOEXCEPT template <size_t _Size> inline -void +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void __bitset<1, _Size>::operator|=(const __bitset& __v) _NOEXCEPT { __first_ |= __v.__first_; @@ -543,7 +549,7 @@ __bitset<1, _Size>::operator|=(const __bitset& __v) _NOEXCEPT template <size_t _Size> inline -void +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void __bitset<1, _Size>::operator^=(const __bitset& __v) _NOEXCEPT { __first_ ^= __v.__first_; @@ -551,7 +557,7 @@ __bitset<1, _Size>::operator^=(const __bitset& __v) _NOEXCEPT template <size_t _Size> inline -void +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void __bitset<1, _Size>::flip() _NOEXCEPT { __storage_type __m = ~__storage_type(0) >> (__bits_per_word - _Size); @@ -561,7 +567,7 @@ __bitset<1, _Size>::flip() _NOEXCEPT template <size_t _Size> inline -unsigned long +_LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long __bitset<1, _Size>::to_ulong() const { return __first_; @@ -569,7 +575,7 @@ __bitset<1, _Size>::to_ulong() const template <size_t _Size> inline -unsigned long long +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long __bitset<1, _Size>::to_ullong() const { return __first_; @@ -577,7 +583,7 @@ __bitset<1, _Size>::to_ullong() const template <size_t _Size> inline -bool +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool __bitset<1, _Size>::all() const _NOEXCEPT { __storage_type __m = ~__storage_type(0) >> (__bits_per_word - _Size); @@ -586,7 +592,7 @@ __bitset<1, _Size>::all() const _NOEXCEPT template <size_t _Size> inline -bool +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool __bitset<1, _Size>::any() const _NOEXCEPT { __storage_type __m = ~__storage_type(0) >> (__bits_per_word - _Size); @@ -630,26 +636,26 @@ protected: _LIBCPP_INLINE_VISIBILITY explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY _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 {return const_reference(nullptr, 1);} - _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 iterator __make_iter(size_t) _NOEXCEPT {return iterator(nullptr, 0);} - _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 const_iterator __make_iter(size_t) const _NOEXCEPT {return const_iterator(nullptr, 0);} - _LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {} - _LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {} - _LIBCPP_INLINE_VISIBILITY 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_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator^=(const __bitset&) _NOEXCEPT {} - _LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void flip() _NOEXCEPT {} - _LIBCPP_INLINE_VISIBILITY unsigned long to_ulong() const {return 0;} - _LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const {return 0;} + _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_INLINE_VISIBILITY bool all() const _NOEXCEPT {return true;} - _LIBCPP_INLINE_VISIBILITY bool any() const _NOEXCEPT {return false;} + _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_INLINE_VISIBILITY size_t __hash_code() const _NOEXCEPT {return 0;} }; @@ -686,10 +692,12 @@ public: _LIBCPP_INLINE_VISIBILITY _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, typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos, _CharT __zero = _CharT('0'), _CharT __one = _CharT('1')); template<class _CharT, class _Traits, class _Allocator> + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 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 = @@ -697,24 +705,29 @@ public: _CharT __zero = _CharT('0'), _CharT __one = _CharT('1')); // 23.3.5.2 bitset operations: - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& operator&=(const bitset& __rhs) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& operator|=(const bitset& __rhs) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _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_INLINE_VISIBILITY _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_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& reset() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& reset(size_t __pos); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator~() const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& flip() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& flip(size_t __pos); // element access: @@ -723,41 +736,43 @@ public: #else _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference operator[](size_t __p) const {return base::__make_ref(__p);} #endif - _LIBCPP_HIDE_FROM_ABI reference operator[](size_t __p) {return base::__make_ref(__p);} - _LIBCPP_INLINE_VISIBILITY + _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 unsigned long to_ulong() const; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _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_INLINE_VISIBILITY _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_INLINE_VISIBILITY _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_INLINE_VISIBILITY _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_INLINE_VISIBILITY _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_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const bitset& __rhs) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator!=(const bitset& __rhs) const _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool test(size_t __pos) const; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bool all() const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bool any() const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY bool none() const _NOEXCEPT {return !any();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bool none() const _NOEXCEPT {return !any();} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator<<(size_t __pos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator>>(size_t __pos) const _NOEXCEPT; private: @@ -770,6 +785,7 @@ private: template <size_t _Size> template<class _CharT, class> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>::bitset(const _CharT* __str, typename basic_string<_CharT>::size_type __n, _CharT __zero, _CharT __one) @@ -791,6 +807,7 @@ bitset<_Size>::bitset(const _CharT* __str, template <size_t _Size> template<class _CharT, class _Traits, class _Allocator> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str, typename basic_string<_CharT,_Traits,_Allocator>::size_type __pos, typename basic_string<_CharT,_Traits,_Allocator>::size_type __n, @@ -816,6 +833,7 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str, template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::operator&=(const bitset& __rhs) _NOEXCEPT { @@ -825,6 +843,7 @@ bitset<_Size>::operator&=(const bitset& __rhs) _NOEXCEPT template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::operator|=(const bitset& __rhs) _NOEXCEPT { @@ -834,6 +853,7 @@ bitset<_Size>::operator|=(const bitset& __rhs) _NOEXCEPT template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::operator^=(const bitset& __rhs) _NOEXCEPT { @@ -842,6 +862,7 @@ bitset<_Size>::operator^=(const bitset& __rhs) _NOEXCEPT } template <size_t _Size> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::operator<<=(size_t __pos) _NOEXCEPT { @@ -852,6 +873,7 @@ bitset<_Size>::operator<<=(size_t __pos) _NOEXCEPT } template <size_t _Size> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::operator>>=(size_t __pos) _NOEXCEPT { @@ -863,6 +885,7 @@ bitset<_Size>::operator>>=(size_t __pos) _NOEXCEPT template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::set() _NOEXCEPT { @@ -871,6 +894,7 @@ bitset<_Size>::set() _NOEXCEPT } template <size_t _Size> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::set(size_t __pos, bool __val) { @@ -883,6 +907,7 @@ bitset<_Size>::set(size_t __pos, bool __val) template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::reset() _NOEXCEPT { @@ -891,6 +916,7 @@ bitset<_Size>::reset() _NOEXCEPT } template <size_t _Size> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::reset(size_t __pos) { @@ -903,6 +929,7 @@ bitset<_Size>::reset(size_t __pos) template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size> bitset<_Size>::operator~() const _NOEXCEPT { @@ -913,6 +940,7 @@ bitset<_Size>::operator~() const _NOEXCEPT template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::flip() _NOEXCEPT { @@ -921,6 +949,7 @@ bitset<_Size>::flip() _NOEXCEPT } template <size_t _Size> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::flip(size_t __pos) { @@ -934,6 +963,7 @@ bitset<_Size>::flip(size_t __pos) template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long bitset<_Size>::to_ulong() const { @@ -942,6 +972,7 @@ bitset<_Size>::to_ulong() const template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long bitset<_Size>::to_ullong() const { @@ -950,6 +981,7 @@ bitset<_Size>::to_ullong() const template <size_t _Size> template <class _CharT, class _Traits, class _Allocator> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, _Traits, _Allocator> bitset<_Size>::to_string(_CharT __zero, _CharT __one) const { @@ -965,6 +997,7 @@ bitset<_Size>::to_string(_CharT __zero, _CharT __one) const template <size_t _Size> template <class _CharT, class _Traits> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, _Traits, allocator<_CharT> > bitset<_Size>::to_string(_CharT __zero, _CharT __one) const { @@ -974,6 +1007,7 @@ bitset<_Size>::to_string(_CharT __zero, _CharT __one) const template <size_t _Size> template <class _CharT> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > bitset<_Size>::to_string(_CharT __zero, _CharT __one) const { @@ -982,6 +1016,7 @@ bitset<_Size>::to_string(_CharT __zero, _CharT __one) const template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<char, char_traits<char>, allocator<char> > bitset<_Size>::to_string(char __zero, char __one) const { @@ -990,6 +1025,7 @@ bitset<_Size>::to_string(char __zero, char __one) const template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 size_t bitset<_Size>::count() const _NOEXCEPT { @@ -998,6 +1034,7 @@ bitset<_Size>::count() const _NOEXCEPT template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT { @@ -1006,6 +1043,7 @@ bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool bitset<_Size>::operator!=(const bitset& __rhs) const _NOEXCEPT { @@ -1013,6 +1051,7 @@ bitset<_Size>::operator!=(const bitset& __rhs) const _NOEXCEPT } template <size_t _Size> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool bitset<_Size>::test(size_t __pos) const { @@ -1024,6 +1063,7 @@ bitset<_Size>::test(size_t __pos) const template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool bitset<_Size>::all() const _NOEXCEPT { @@ -1032,6 +1072,7 @@ bitset<_Size>::all() const _NOEXCEPT template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool bitset<_Size>::any() const _NOEXCEPT { @@ -1040,6 +1081,7 @@ bitset<_Size>::any() const _NOEXCEPT template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size> bitset<_Size>::operator<<(size_t __pos) const _NOEXCEPT { @@ -1050,6 +1092,7 @@ bitset<_Size>::operator<<(size_t __pos) const _NOEXCEPT template <size_t _Size> inline +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size> bitset<_Size>::operator>>(size_t __pos) const _NOEXCEPT { @@ -1059,7 +1102,7 @@ bitset<_Size>::operator>>(size_t __pos) const _NOEXCEPT } template <size_t _Size> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size> operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT { @@ -1069,7 +1112,7 @@ operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT } template <size_t _Size> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size> operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT { @@ -1079,7 +1122,7 @@ operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT } template <size_t _Size> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size> operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT { @@ -1098,15 +1141,19 @@ struct _LIBCPP_TEMPLATE_VIS hash<bitset<_Size> > }; template <class _CharT, class _Traits, size_t _Size> -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x); template <class _CharT, class _Traits, size_t _Size> -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x); _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS +#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include <concepts> +#endif + #endif // _LIBCPP_BITSET |
