# std::__debug::bitset< _Nb > Class Template Reference

Inheritance diagram for std::__debug::bitset< _Nb >:

List of all members.

## Detailed Description

### template<size_t _Nb>
class std::__debug::bitset< _Nb >

Definition at line 47 of file debug/bitset.

## Public Member Functions

- size_t _Find_first () const
- size_t _Find_next (size_t __prev) const
- const _Base & _M_base () const
- _Base & _M_base ()
- template<class _CharT, class _Traits, class _Alloc> void _M_copy_from_string (const std::basic_string< _CharT, _Traits, _Alloc > &__s, size_t, size_t)
- template<class _CharT, class _Traits, class _Alloc> void _M_copy_to_string (std::basic_string< _CharT, _Traits, _Alloc > &) const
- void _M_invalidate_all () const
- bool any () const
- bitset (const _Base &__x)
- template<typename _CharT, typename _Traits, typename _Allocator> bitset (const std::basic_string< _CharT, _Traits, _Allocator > &__str, typename std::basic_string< _CharT, _Traits, _Allocator >::size_type __pos=0, typename std::basic_string< _CharT, _Traits, _Allocator >::size_type __n=(std::basic_string< _CharT, _Traits, _Allocator >::npos))
- bitset (unsigned long __val)
- bitset ()
- size_t count () const
- bitset< _Nb > & flip (size_t __pos)
- bitset< _Nb > & flip ()
- bool none () const
- bitset< _Nb > & operator &= (const bitset< _Nb > &__rhs)
- bool operator!= (const bitset< _Nb > &__rhs) const
- bitset< _Nb > operator<< (size_t __pos) const
- bitset< _Nb > & operator<<= (size_t __pos)
- bool operator== (const bitset< _Nb > &__rhs) const
- bitset< _Nb > operator>> (size_t __pos) const
- bitset< _Nb > & operator>>= (size_t __pos)
- bool operator[] (size_t __pos) const
- reference operator[] (size_t __pos)
- bitset< _Nb > & operator^= (const bitset< _Nb > &__rhs)
- bitset< _Nb > & operator|= (const bitset< _Nb > &__rhs)
- bitset< _Nb > operator~ () const
- bitset< _Nb > & reset (size_t __pos)
- bitset< _Nb > & reset ()
- bitset< _Nb > & set (size_t __pos, bool __val=true)
- bitset< _Nb > & set ()
- size_t size () const
- bool test (size_t __position) const
- std::basic_string< char, std::char_traits<
  char >, std::allocator< char > > to_string () const
- template<typename _CharT> std::basic_string< _CharT,
  std::char_traits< _CharT >,
  std::allocator< _CharT > > to_string () const
- template<typename _CharT, typename _Traits> std::basic_string< _CharT,
  _Traits, std::allocator<
  _CharT > > to_string () const
- template<typename _CharT, typename _Traits, typename _Allocator> std::basic_string< _CharT,
  _Traits, _Allocator > to_string () const
- unsigned long to_ulong () const

- bitset< _Nb > & _Unchecked_flip (size_t __pos)
- bitset< _Nb > & _Unchecked_reset (size_t __pos)
- bitset< _Nb > & _Unchecked_set (size_t __pos, int __val)
- bitset< _Nb > & _Unchecked_set (size_t __pos)
- bool _Unchecked_test (size_t __pos) const

- bitset< _Nb > & operator &= (const bitset< _Nb > &__rhs)
- bitset< _Nb > & operator^= (const bitset< _Nb > &__rhs)
- bitset< _Nb > & operator|= (const bitset< _Nb > &__rhs)

- bool operator!= (const bitset< _Nb > &__rhs) const
- bool operator== (const bitset< _Nb > &__rhs) const

- template<> bool test (size_t) const

## Public Attributes

- _Safe_iterator_base * _M_const_iterators
- _Safe_iterator_base * _M_iterators
- unsigned int _M_version

## Protected Member Functions

- void _M_detach_all ()
- void _M_detach_singular ()
- __gnu_cxx::__mutex & _M_get_mutex ()
- void _M_revalidate_singular ()
- void _M_swap (_Safe_sequence_base &__x)

## Friends

- class reference

## Classes

- class reference

## Constructor & Destructor Documentation

template<size_t _Nb>

std::__debug::bitset< _Nb >::bitset | ( |  | ) | `[inline]`

All bits set to zero.

Reimplemented from std::bitset< _Nb >.

Definition at line 125 of file debug/bitset.

Referenced by std::__debug::bitset< _Nb >::operator~().

template<size_t _Nb>

std::__debug::bitset< _Nb >::bitset | ( | unsigned long | __val | ) | `[inline]`

Initial bits bitwise-copied from a single word (others set to zero).

Reimplemented from std::bitset< _Nb >.

Definition at line 127 of file debug/bitset.

## Member Function Documentation

void __gnu_debug::_Safe_sequence_base::_M_detach_all | ( |  | ) | `[protected, inherited]`

Detach all iterators, leaving them singular.

Referenced by __gnu_debug::_Safe_sequence_base::~_Safe_sequence_base().

void __gnu_debug::_Safe_sequence_base::_M_detach_singular | ( |  | ) | `[protected, inherited]`

Detach all singular iterators.

Postcondition:
  for all iterators i attached to this sequence, i->_M_version == _M_version.

Referenced by std::__debug::deque< _Tp, _Allocator >::erase(), and std::__debug::list< _Tp, _Allocator >::resize().

__gnu_cxx::__mutex& __gnu_debug::_Safe_sequence_base::_M_get_mutex | ( |  | ) | `[protected, inherited]`

For use in _Safe_sequence.

void __gnu_debug::_Safe_sequence_base::_M_invalidate_all | ( |  | ) | const`[inline, inherited]`

Invalidates all iterators.

Definition at line 220 of file safe_base.h.

References __gnu_debug::_Safe_sequence_base::_M_version.

Referenced by __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::append(), std::__debug::vector< _Tp, _Allocator >::assign(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::assign(), std::__debug::deque< _Tp, _Allocator >::assign(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::c_str(), std::__debug::vector< _Tp, _Allocator >::clear(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::clear(), std::__debug::deque< _Tp, _Allocator >::clear(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::data(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::erase(), std::__debug::deque< _Tp, _Allocator >::erase(), __gnu_debug::getline(), std::__debug::vector< _Tp, _Allocator >::insert(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::insert(), std::__debug::deque< _Tp, _Allocator >::insert(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::operator+=(), std::__debug::vector< _Tp, _Allocator >::operator=(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::operator=(), std::__debug::deque< _Tp, _Allocator >::operator=(), __gnu_debug::operator>>(), std::__debug::vector< _Tp, _Allocator >::push_back(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::push_back(), std::__debug::deque< _Tp, _Allocator >::push_back(), std::__debug::deque< _Tp, _Allocator >::push_front(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::replace(), std::__debug::vector< _Tp, _Allocator >::reserve(), std::__debug::vector< _Tp, _Allocator >::resize(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::resize(), std::__debug::deque< _Tp, _Allocator >::resize(), and __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::swap().

void __gnu_debug::_Safe_sequence_base::_M_revalidate_singular | ( |  | ) | `[protected, inherited]`

Revalidates all attached singular iterators. This method may be used to validate iterators that were invalidated before (but for some reasion, such as an exception, need to become valid again).

Referenced by std::__debug::deque< _Tp, _Allocator >::erase(), and std::__debug::list< _Tp, _Allocator >::resize().

void __gnu_debug::_Safe_sequence_base::_M_swap | ( | _Safe_sequence_base & | __x | ) | `[protected, inherited]`

Swap this sequence with the given sequence. This operation also swaps ownership of the iterators, so that when the operation is complete all iterators that originally referenced one container now reference the other container.

Referenced by std::__debug::vector< _Tp, _Allocator >::swap(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::swap(), std::__debug::set< _Key, _Compare, _Allocator >::swap(), std::__debug::multiset< _Key, _Compare, _Allocator >::swap(), std::__debug::multimap< _Key, _Tp, _Compare, _Allocator >::swap(), std::__debug::map< _Key, _Tp, _Compare, _Allocator >::swap(), std::__debug::list< _Tp, _Allocator >::swap(), __gnu_cxx::__debug::hash_set< _Value, _HashFcn, _EqualKey, _Alloc >::swap(), __gnu_cxx::__debug::hash_multiset< _Value, _HashFcn, _EqualKey, _Alloc >::swap(), __gnu_cxx::__debug::hash_multimap< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::swap(), __gnu_cxx::__debug::hash_map< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::swap(), and std::__debug::deque< _Tp, _Allocator >::swap().

template<size_t _Nb>

bool std::bitset< _Nb >::any | ( |  | ) | const`[inline, inherited]`

Tests whether any of the bits are on.

Returns:
  True if at least one bit is set.

Definition at line 1100 of file bitset.

References std::_Base_bitset< _Nw >::_M_is_any().

template<size_t _Nb>

size_t std::bitset< _Nb >::count | ( |  | ) | const`[inline, inherited]`

Returns the number of bits which are set.

Definition at line 1062 of file bitset.

References std::_Base_bitset< _Nw >::_M_do_count().

template<size_t _Nb>

bitset<_Nb>& std::__debug::bitset< _Nb >::flip | ( | size_t | __pos | ) | `[inline]`

Toggles a given bit to its opposite value.

Parameters:

  | position | The index of the bit.

Exceptions:

  | std::out_of_range | If pos is bigger the size of the set.

Reimplemented from std::bitset< _Nb >.

Definition at line 216 of file debug/bitset.

References std::bitset< _Nb >::flip().

template<size_t _Nb>

bitset<_Nb>& std::__debug::bitset< _Nb >::flip | ( |  | ) | `[inline]`

Toggles every bit to its opposite value.

Reimplemented from std::bitset< _Nb >.

Definition at line 209 of file debug/bitset.

References std::bitset< _Nb >::flip().

template<size_t _Nb>

bool std::bitset< _Nb >::none | ( |  | ) | const`[inline, inherited]`

Tests whether any of the bits are on.

Returns:
  True if none of the bits are set.

Definition at line 1108 of file bitset.

References std::_Base_bitset< _Nw >::_M_is_any().

template<size_t _Nb>

bitset<_Nb>& std::bitset< _Nb >::operator &= | ( | const bitset< _Nb > & | __rhs | ) | `[inline, inherited]`

Operations on bitsets.

Parameters:

  | rhs | A same-sized bitset.

These should be self-explanatory.

Definition at line 795 of file bitset.

References std::_Base_bitset< _Nw >::_M_do_and().

template<size_t _Nb>

bitset<_Nb> std::__debug::bitset< _Nb >::operator<< | ( | size_t | __pos | ) | const`[inline]`

Self-explanatory.

Reimplemented from std::bitset< _Nb >.

Definition at line 286 of file debug/bitset.

References std::__debug::bitset< _Nb >::_M_base().

template<size_t _Nb>

bitset<_Nb>& std::__debug::bitset< _Nb >::operator<<= | ( | size_t | __pos | ) | `[inline]`

Operations on bitsets.

Parameters:

  | position | The number of places to shift.

These should be self-explanatory.

Reimplemented from std::bitset< _Nb >.

Definition at line 163 of file debug/bitset.

References std::__debug::bitset< _Nb >::_M_base().

template<size_t _Nb>

bool std::bitset< _Nb >::operator== | ( | const bitset< _Nb > & | __rhs | ) | const`[inline, inherited]`

These comparisons for equality/inequality are, well, bitwise.

Definition at line 1073 of file bitset.

References std::_Base_bitset< _Nw >::_M_is_equal().

template<size_t _Nb>

bitset<_Nb> std::__debug::bitset< _Nb >::operator>> | ( | size_t | __pos | ) | const`[inline]`

Self-explanatory.

Reimplemented from std::bitset< _Nb >.

Definition at line 290 of file debug/bitset.

References std::__debug::bitset< _Nb >::_M_base().

template<size_t _Nb>

bitset<_Nb>& std::__debug::bitset< _Nb >::operator>>= | ( | size_t | __pos | ) | `[inline]`

Operations on bitsets.

Parameters:

  | position | The number of places to shift.

These should be self-explanatory.

Reimplemented from std::bitset< _Nb >.

Definition at line 170 of file debug/bitset.

References std::__debug::bitset< _Nb >::_M_base().

template<size_t _Nb>

reference std::__debug::bitset< _Nb >::operator[] | ( | size_t | __pos | ) | `[inline]`

Array-indexing support.

Parameters:

  | position | Index into the bitset.

Returns:
  A bool for a 'const bitset'. For non-const bitsets, an instance of the reference proxy class.

Note:
  These operators do no range checking and throw no exceptions, as required by DR 11 to the standard.

Reimplemented from std::bitset< _Nb >.

Definition at line 226 of file debug/bitset.

References __glibcxx_check_subscript, std::__debug::bitset< _Nb >::_M_base(), and std::bitset< _Nb >::reference.

template<size_t _Nb>

bitset<_Nb>& std::bitset< _Nb >::operator^= | ( | const bitset< _Nb > & | __rhs | ) | `[inline, inherited]`

Operations on bitsets.

Parameters:

  | rhs | A same-sized bitset.

These should be self-explanatory.

Definition at line 809 of file bitset.

References std::_Base_bitset< _Nw >::_M_do_xor().

template<size_t _Nb>

bitset<_Nb>& std::bitset< _Nb >::operator|= | ( | const bitset< _Nb > & | __rhs | ) | `[inline, inherited]`

Operations on bitsets.

Parameters:

  | rhs | A same-sized bitset.

These should be self-explanatory.

Definition at line 802 of file bitset.

References std::_Base_bitset< _Nw >::_M_do_or().

template<size_t _Nb>

bitset<_Nb> std::__debug::bitset< _Nb >::operator~ | ( |  | ) | const`[inline]`

See the no-argument flip().

Reimplemented from std::bitset< _Nb >.

Definition at line 206 of file debug/bitset.

References std::__debug::bitset< _Nb >::_M_base(), and std::__debug::bitset< _Nb >::bitset().

template<size_t _Nb>

bitset<_Nb>& std::__debug::bitset< _Nb >::reset | ( | size_t | __pos | ) | `[inline]`

Sets a given bit to false.

Parameters:

  | position | The index of the bit.

Exceptions:

  | std::out_of_range | If pos is bigger the size of the set.

Same as writing `set(pos,false)`.

Reimplemented from std::bitset< _Nb >.

Definition at line 200 of file debug/bitset.

References std::bitset< _Nb >::reset().

template<size_t _Nb>

bitset<_Nb>& std::__debug::bitset< _Nb >::reset | ( |  | ) | `[inline]`

Sets every bit to false.

Reimplemented from std::bitset< _Nb >.

Definition at line 193 of file debug/bitset.

References std::bitset< _Nb >::reset().

template<size_t _Nb>

bitset<_Nb>& std::__debug::bitset< _Nb >::set | ( | size_t | __pos,
|  | bool | __val = `true` |
| ) |  |  | `[inline]`

Sets a given bit to a particular value.

Parameters:

  | position | The index of the bit.
  | val | Either true or false, defaults to true.

Exceptions:

  | std::out_of_range | If pos is bigger the size of the set.

Reimplemented from std::bitset< _Nb >.

Definition at line 186 of file debug/bitset.

References std::bitset< _Nb >::set().

template<size_t _Nb>

bitset<_Nb>& std::__debug::bitset< _Nb >::set | ( |  | ) | `[inline]`

Sets every bit to true.

Reimplemented from std::bitset< _Nb >.

Definition at line 177 of file debug/bitset.

References std::bitset< _Nb >::set().

template<size_t _Nb>

size_t std::bitset< _Nb >::size | ( |  | ) | const`[inline, inherited]`

Returns the total number of bits.

Definition at line 1067 of file bitset.

template<size_t _Nb>

bool std::bitset< _Nb >::test | ( | size_t | __position | ) | const`[inline, inherited]`

Tests the value of a bit.

Parameters:

  | position | The index of a bit.

Returns:
  The value at pos.

Exceptions:

  | std::out_of_range | If pos is bigger the size of the set.

Definition at line 1088 of file bitset.

References __N, and std::bitset< _Nb >::_Unchecked_test().

template<size_t _Nb>

std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::__debug::bitset< _Nb >::to_string | ( |  | ) | const`[inline]`

Retuns a character interpretation of the bitset.

Returns:
  The string equivalent of the bits.

Note the ordering of the bits: decreasing character positions correspond to increasing bit positions (see the main class notes for an example).

Reimplemented from std::bitset< _Nb >.

Definition at line 265 of file debug/bitset.

template<size_t _Nb>
template<typename _CharT>

std::basic_string<_CharT, std::char_traits<_CharT>, std::allocator<_CharT> > std::__debug::bitset< _Nb >::to_string | ( |  | ) | const`[inline]`

Retuns a character interpretation of the bitset.

Returns:
  The string equivalent of the bits.

Note the ordering of the bits: decreasing character positions correspond to increasing bit positions (see the main class notes for an example).

Reimplemented from std::bitset< _Nb >.

Definition at line 258 of file debug/bitset.

template<size_t _Nb>
template<typename _CharT, typename _Traits>

std::basic_string<_CharT, _Traits, std::allocator<_CharT> > std::__debug::bitset< _Nb >::to_string | ( |  | ) | const`[inline]`

Retuns a character interpretation of the bitset.

Returns:
  The string equivalent of the bits.

Note the ordering of the bits: decreasing character positions correspond to increasing bit positions (see the main class notes for an example).

Reimplemented from std::bitset< _Nb >.

Definition at line 252 of file debug/bitset.

template<size_t _Nb>
template<typename _CharT, typename _Traits, typename _Allocator>

std::basic_string<_CharT, _Traits, _Allocator> std::__debug::bitset< _Nb >::to_string | ( |  | ) | const`[inline]`

Retuns a character interpretation of the bitset.

Returns:
  The string equivalent of the bits.

Note the ordering of the bits: decreasing character positions correspond to increasing bit positions (see the main class notes for an example).

Reimplemented from std::bitset< _Nb >.

Definition at line 245 of file debug/bitset.

References std::__debug::bitset< _Nb >::_M_base().

template<size_t _Nb>

unsigned long std::bitset< _Nb >::to_ulong | ( |  | ) | const`[inline, inherited]`

Retuns a numerical interpretation of the bitset.

Returns:
  The integral equivalent of the bits.

Exceptions:

  | std::overflow_error | If there are too many bits to be represented in an `unsigned` `long`.

Definition at line 1006 of file bitset.

References std::_Base_bitset< _Nw >::_M_do_to_ulong().

## Member Data Documentation

_Safe_iterator_base* __gnu_debug::_Safe_sequence_base::_M_const_iterators `[inherited]`

The list of constant iterators that reference this container.

Definition at line 171 of file safe_base.h.

Referenced by __gnu_debug::_Safe_sequence< _Sequence >::_M_invalidate_if(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_invalidate_single(), and __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_iter().

_Safe_iterator_base* __gnu_debug::_Safe_sequence_base::_M_iterators `[inherited]`

The list of mutable iterators that reference this container.

Definition at line 168 of file safe_base.h.

Referenced by __gnu_debug::_Safe_sequence< _Sequence >::_M_invalidate_if(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_invalidate_single(), and __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_iter().

unsigned int __gnu_debug::_Safe_sequence_base::_M_version `[mutable, inherited]`

The container version number. This number may never be 0.

Definition at line 174 of file safe_base.h.

Referenced by __gnu_debug::_Safe_sequence_base::_M_invalidate_all().

The documentation for this class was generated from the following file:

- debug/bitset