29 #ifndef _GLIBCXX_PROFILE_BITSET
30 #define _GLIBCXX_PROFILE_BITSET
34 namespace std _GLIBCXX_VISIBILITY(default)
41 :
public _GLIBCXX_STD_C::bitset<_Nb>
43 typedef _GLIBCXX_STD_C::bitset<_Nb>
_Base;
48 :
private _Base::reference
50 typedef typename _Base::reference _Base_ref;
60 reference(
const reference& __x)
67 *
static_cast<_Base_ref*
>(
this) = __x;
72 operator=(
const reference& __x)
74 *
static_cast<_Base_ref*
>(
this) = __x;
81 return ~(*
static_cast<const _Base_ref*
>(
this));
86 return *
static_cast<const _Base_ref*
>(
this);
100 #ifdef __GXX_EXPERIMENTAL_CXX0X__
101 constexpr bitset(
unsigned long long __val)
103 bitset(
unsigned long __val)
107 template<
typename _CharT,
typename _Traits,
typename _Alloc>
110 typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
112 typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
114 :
_Base(__str, __pos, __n) { }
118 template<
class _CharT,
class _Traits,
class _Alloc>
120 typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
122 typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
124 _CharT __zero, _CharT __one = _CharT(
'1'))
125 :
_Base(__str, __pos, __n, __zero, __one) { }
129 #ifdef __GXX_EXPERIMENTAL_CXX0X__
130 template<
typename _CharT>
132 bitset(
const _CharT* __str,
133 typename std::basic_string<_CharT>::size_type __n
135 _CharT __zero = _CharT(
'0'), _CharT __one = _CharT(
'1'))
136 :
_Base(__str, __n, __zero, __one) { }
185 set(
size_t __pos,
bool __val =
true)
227 return reference(_M_base()[__pos],
this);
235 return _M_base()[__pos];
239 #ifdef __GXX_EXPERIMENTAL_CXX0X__
240 using _Base::to_ullong;
243 template <
typename _CharT,
typename _Traits,
typename _Alloc>
246 {
return _M_base().template to_string<_CharT, _Traits, _Alloc>(); }
250 template<
class _CharT,
class _Traits,
class _Alloc>
252 to_string(_CharT __zero, _CharT __one = _CharT(
'1'))
const
254 return _M_base().template
255 to_string<_CharT, _Traits, _Alloc>(__zero, __one);
260 template<
typename _CharT,
typename _Traits>
263 {
return to_string<_CharT, _Traits, std::allocator<_CharT> >(); }
267 template<
class _CharT,
class _Traits>
269 to_string(_CharT __zero, _CharT __one = _CharT(
'1'))
const
273 template<
typename _CharT>
278 return to_string<_CharT, std::char_traits<_CharT>,
282 template<
class _CharT>
285 to_string(_CharT __zero, _CharT __one = _CharT(
'1'))
const
287 return to_string<_CharT, std::char_traits<_CharT>,
298 to_string(
char __zero,
char __one =
'1')
const
300 return to_string<char, std::char_traits<char>,
309 {
return _M_base() == __rhs; }
313 {
return _M_base() != __rhs; }
321 operator<<(
size_t __pos)
const
325 operator>>(
size_t __pos)
const
329 _M_base() {
return *
this; }
332 _M_base()
const {
return *
this; }
342 operator|(
const bitset<_Nb>& __x,
const bitset<_Nb>& __y)
343 {
return bitset<_Nb>(__x) |= __y; }
347 operator^(
const bitset<_Nb>& __x,
const bitset<_Nb>& __y)
348 {
return bitset<_Nb>(__x) ^= __y; }
350 template<
typename _CharT,
typename _Traits,
size_t _Nb>
353 {
return __is >> __x._M_base(); }
355 template<
typename _CharT,
typename _Traits,
size_t _Nb>
357 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
358 const bitset<_Nb>& __x)
359 {
return __os << __x._M_base(); }
362 #ifdef __GXX_EXPERIMENTAL_CXX0X__
366 struct hash<__profile::bitset<_Nb>>
367 :
public __hash_base<size_t, __profile::bitset<_Nb>>
bitset< _Nb > & set()
Sets every bit to true.
reference operator[](size_t __position)
Array-indexing support.
Controlling output.This is the base class for all output streams. It provides text formatting of all ...
bitset< _Nb > & operator>>=(size_t __position)
Operations on bitsets.
bool test(size_t __position) const
Tests the value of a bit.
bitset< _Nb > operator>>(size_t __position) const
Self-explanatory.
Controlling input.This is the base class for all input streams. It provides text formatting of all bu...
bool all() const
Tests whether all the bits are on.
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Class std::bitset wrapper with performance instrumentation.
Primary class template hash.
std::basic_string< _CharT, _Traits, _Alloc > to_string() const
Returns a character interpretation of the bitset.
constexpr size_t size() const
Returns the total number of bits.
bitset< _Nb > & reset()
Sets every bit to false.
Managing sequences of characters and character-like objects.
bitset< _Nb > & operator<<=(size_t __position)
Operations on bitsets.
bitset< _Nb > operator~() const
See the no-argument flip().
bitset< _Nb > & flip()
Toggles every bit to its opposite value.
bitset< _Nb > operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y)
Global bitwise operations on bitsets.
bool any() const
Tests whether any of the bits are on.
size_t count() const
Returns the number of bits which are set.
bool none() const
Tests whether any of the bits are on.
bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y)
Global bitwise operations on bitsets.
The standard allocator, as per [20.4].Further details: http://gcc.gnu.org/onlinedocs/libstdc++/manual...
unsigned long to_ulong() const
Returns a numerical interpretation of the bitset.