mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-09-10 18:53:48 +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
386
third_party/libcxx/bitset
vendored
386
third_party/libcxx/bitset
vendored
|
@ -1,5 +1,5 @@
|
|||
// -*- C++ -*-
|
||||
//===---------------------------- bitset ----------------------------------===//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
|
@ -10,25 +10,6 @@
|
|||
#ifndef _LIBCPP_BITSET
|
||||
#define _LIBCPP_BITSET
|
||||
|
||||
#include "third_party/libcxx/__config"
|
||||
#include "third_party/libcxx/__bit_reference"
|
||||
#include "third_party/libcxx/cstddef"
|
||||
#include "third_party/libcxx/climits"
|
||||
#include "third_party/libcxx/string"
|
||||
#include "third_party/libcxx/stdexcept"
|
||||
#include "third_party/libcxx/iosfwd"
|
||||
#include "third_party/libcxx/__functional_base"
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include "third_party/libcxx/__undef_macros"
|
||||
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
/*
|
||||
bitset synopsis
|
||||
|
||||
|
@ -61,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>&
|
||||
|
@ -131,6 +112,34 @@ template <size_t N> struct hash<std::bitset<N>>;
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/fill.h>
|
||||
#include <__assert> // all public C++ headers provide the assertion handler
|
||||
#include <__bit_reference>
|
||||
#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>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
class __bitset;
|
||||
|
||||
|
@ -171,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:
|
||||
|
@ -202,15 +211,18 @@ private:
|
|||
void __init(unsigned long long __v, false_type) _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __init(unsigned long long __v, true_type) _NOEXCEPT;
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
#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;
|
||||
};
|
||||
|
||||
|
@ -258,7 +270,7 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT
|
|||
_VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline
|
||||
|
@ -283,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)
|
||||
|
@ -292,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)
|
||||
|
@ -301,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)
|
||||
|
@ -309,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
|
||||
|
@ -328,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);
|
||||
|
@ -341,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);
|
||||
|
@ -361,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)>());
|
||||
|
@ -369,24 +381,24 @@ __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];
|
||||
for (std::size_t __i = 1; __i < sizeof(unsigned long long) / sizeof(__storage_type); ++__i)
|
||||
for (size_t __i = 1; __i < sizeof(unsigned long long) / sizeof(__storage_type); ++__i)
|
||||
__r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT);
|
||||
return __r;
|
||||
}
|
||||
|
||||
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
|
||||
|
@ -406,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
|
||||
|
@ -467,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
|
||||
|
@ -521,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_;
|
||||
|
@ -529,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_;
|
||||
|
@ -537,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_;
|
||||
|
@ -545,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);
|
||||
|
@ -555,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_;
|
||||
|
@ -563,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_;
|
||||
|
@ -571,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);
|
||||
|
@ -580,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);
|
||||
|
@ -624,26 +636,26 @@ protected:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
|
||||
{return reference(0, 1);}
|
||||
_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(0, 1);}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT
|
||||
{return iterator(0, 0);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT
|
||||
{return const_iterator(0, 0);}
|
||||
{return const_reference(nullptr, 1);}
|
||||
_LIBCPP_INLINE_VISIBILITY _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
|
||||
{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;}
|
||||
};
|
||||
|
@ -679,11 +691,13 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bitset() _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
bitset(unsigned long long __v) _NOEXCEPT : base(__v) {}
|
||||
template<class _CharT, class = _EnableIf<_IsCharLikeType<_CharT>::value> >
|
||||
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 =
|
||||
|
@ -691,64 +705,74 @@ 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:
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
const_reference operator[](size_t __p) const {return base::__make_ref(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](size_t __p) {return base::__make_ref(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator[](size_t __p) const {return base::__make_ref(__p);}
|
||||
#else
|
||||
_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
|
||||
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:
|
||||
|
@ -761,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)
|
||||
|
@ -770,21 +795,19 @@ bitset<_Size>::bitset(const _CharT* __str,
|
|||
if (__str[__i] != __zero && __str[__i] != __one)
|
||||
__throw_invalid_argument("bitset string ctor has invalid argument");
|
||||
|
||||
size_t _Mp = _VSTD::min(__rlen, _Size);
|
||||
size_t __mp = _VSTD::min(__rlen, _Size);
|
||||
size_t __i = 0;
|
||||
for (; __i < _Mp; ++__i)
|
||||
for (; __i < __mp; ++__i)
|
||||
{
|
||||
_CharT __c = __str[_Mp - 1 - __i];
|
||||
if (__c == __zero)
|
||||
(*this)[__i] = false;
|
||||
else
|
||||
(*this)[__i] = true;
|
||||
_CharT __c = __str[__mp - 1 - __i];
|
||||
(*this)[__i] = (__c == __one);
|
||||
}
|
||||
_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
|
||||
}
|
||||
|
||||
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,
|
||||
|
@ -798,21 +821,19 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
|
|||
if (!_Traits::eq(__str[__i], __zero) && !_Traits::eq(__str[__i], __one))
|
||||
__throw_invalid_argument("bitset string ctor has invalid argument");
|
||||
|
||||
size_t _Mp = _VSTD::min(__rlen, _Size);
|
||||
size_t __mp = _VSTD::min(__rlen, _Size);
|
||||
size_t __i = 0;
|
||||
for (; __i < _Mp; ++__i)
|
||||
for (; __i < __mp; ++__i)
|
||||
{
|
||||
_CharT __c = __str[__pos + _Mp - 1 - __i];
|
||||
if (_Traits::eq(__c, __zero))
|
||||
(*this)[__i] = false;
|
||||
else
|
||||
(*this)[__i] = true;
|
||||
_CharT __c = __str[__pos + __mp - 1 - __i];
|
||||
(*this)[__i] = _Traits::eq(__c, __one);
|
||||
}
|
||||
_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
inline
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator&=(const bitset& __rhs) _NOEXCEPT
|
||||
{
|
||||
|
@ -822,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
|
||||
{
|
||||
|
@ -831,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
|
||||
{
|
||||
|
@ -839,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
|
||||
{
|
||||
|
@ -849,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
|
||||
{
|
||||
|
@ -860,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
|
||||
{
|
||||
|
@ -868,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)
|
||||
{
|
||||
|
@ -880,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
|
||||
{
|
||||
|
@ -888,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)
|
||||
{
|
||||
|
@ -900,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
|
||||
{
|
||||
|
@ -910,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
|
||||
{
|
||||
|
@ -918,19 +949,21 @@ bitset<_Size>::flip() _NOEXCEPT
|
|||
}
|
||||
|
||||
template <size_t _Size>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::flip(size_t __pos)
|
||||
{
|
||||
if (__pos >= _Size)
|
||||
__throw_out_of_range("bitset flip argument out of range");
|
||||
|
||||
reference r = base::__make_ref(__pos);
|
||||
r = ~r;
|
||||
reference __r = base::__make_ref(__pos);
|
||||
__r = ~__r;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
inline
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
|
||||
unsigned long
|
||||
bitset<_Size>::to_ulong() const
|
||||
{
|
||||
|
@ -939,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
|
||||
{
|
||||
|
@ -947,11 +981,12 @@ 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
|
||||
{
|
||||
basic_string<_CharT, _Traits, _Allocator> __r(_Size, __zero);
|
||||
for (size_t __i = 0; __i < _Size; ++__i)
|
||||
for (size_t __i = 0; __i != _Size; ++__i)
|
||||
{
|
||||
if ((*this)[__i])
|
||||
__r[_Size - 1 - __i] = __one;
|
||||
|
@ -962,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
|
||||
{
|
||||
|
@ -971,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
|
||||
{
|
||||
|
@ -979,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
|
||||
{
|
||||
|
@ -987,14 +1025,16 @@ 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
|
||||
{
|
||||
return static_cast<size_t>(__count_bool_true(base::__make_iter(0), _Size));
|
||||
return static_cast<size_t>(_VSTD::__count_bool_true(base::__make_iter(0), _Size));
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
inline
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
|
||||
bool
|
||||
bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT
|
||||
{
|
||||
|
@ -1003,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
|
||||
{
|
||||
|
@ -1010,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
|
||||
{
|
||||
|
@ -1021,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
|
||||
{
|
||||
|
@ -1029,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
|
||||
{
|
||||
|
@ -1037,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
|
||||
{
|
||||
|
@ -1047,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
|
||||
{
|
||||
|
@ -1056,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
|
||||
{
|
||||
|
@ -1066,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
|
||||
{
|
||||
|
@ -1076,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
|
||||
{
|
||||
|
@ -1087,7 +1133,7 @@ operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
|
|||
|
||||
template <size_t _Size>
|
||||
struct _LIBCPP_TEMPLATE_VIS hash<bitset<_Size> >
|
||||
: public unary_function<bitset<_Size>, size_t>
|
||||
: public __unary_function<bitset<_Size>, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const bitset<_Size>& __bs) const _NOEXCEPT
|
||||
|
@ -1095,15 +1141,21 @@ 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
|
||||
|
||||
#endif // _LIBCPP_BITSET
|
||||
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
|
||||
# include <concepts>
|
||||
# include <cstdlib>
|
||||
# include <type_traits>
|
||||
#endif
|
||||
|
||||
#endif // _LIBCPP_BITSET
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue