libstdc++: Dynamic Bitset.

libstdc++

Dynamic Bitset.
Extensions
Collaboration diagram for Dynamic Bitset.:

## Classes
struct | std::tr2::__dynamic_bitset_base< _WordT, _Alloc >
class | std::tr2::dynamic_bitset< _WordT, _Alloc >

## Functions
template<typename _CharT, typename _Traits, typename _Alloc1>
void | std::tr2::dynamic_bitset< _WordT, _Alloc >::_M_copy_to_string (std::basic_string< _CharT, _Traits, _Alloc1 > &__str, _CharT __zero=_CharT('0'), _CharT __one=_CharT('1')) const
template<typename _CharT, typename _Traits, typename _WordT, typename _Alloc>
std::basic_ostream< _CharT, _Traits > & | std::tr2::operator<< (std::basic_ostream< _CharT, _Traits > &__os, const dynamic_bitset< _WordT, _Alloc > &__x)
template<typename _CharT, typename _Traits, typename _WordT, typename _Alloc>
std::basic_istream< _CharT, _Traits > & | std::tr2::operator>> (std::basic_istream< _CharT, _Traits > &__is, dynamic_bitset< _WordT, _Alloc > &__x)
template<typename _WordT, typename _Alloc>
bool | std::tr2::operator!= (const dynamic_bitset< _WordT, _Alloc > &__lhs, const dynamic_bitset< _WordT, _Alloc > &__rhs)
template<typename _WordT, typename _Alloc>
bool | std::tr2::operator<= (const dynamic_bitset< _WordT, _Alloc > &__lhs, const dynamic_bitset< _WordT, _Alloc > &__rhs)
template<typename _WordT, typename _Alloc>
bool | std::tr2::operator> (const dynamic_bitset< _WordT, _Alloc > &__lhs, const dynamic_bitset< _WordT, _Alloc > &__rhs)
template<typename _WordT, typename _Alloc>
bool | std::tr2::operator>= (const dynamic_bitset< _WordT, _Alloc > &__lhs, const dynamic_bitset< _WordT, _Alloc > &__rhs)
template<typename _WordT, typename _Alloc>
dynamic_bitset< _WordT, _Alloc > | std::tr2::operator& (const dynamic_bitset< _WordT, _Alloc > &__x, const dynamic_bitset< _WordT, _Alloc > &__y)
template<typename _WordT, typename _Alloc>
dynamic_bitset< _WordT, _Alloc > | std::tr2::operator| (const dynamic_bitset< _WordT, _Alloc > &__x, const dynamic_bitset< _WordT, _Alloc > &__y)
template<typename _WordT, typename _Alloc>
dynamic_bitset< _WordT, _Alloc > | std::tr2::operator^ (const dynamic_bitset< _WordT, _Alloc > &__x, const dynamic_bitset< _WordT, _Alloc > &__y)
template<typename _WordT, typename _Alloc>
dynamic_bitset< _WordT, _Alloc > | std::tr2::operator- (const dynamic_bitset< _WordT, _Alloc > &__x, const dynamic_bitset< _WordT, _Alloc > &__y)

## Detailed Description

## Function Documentation

## ◆ _M_copy_to_string()

template<typename _WordT, typename _Alloc>
template<typename _CharT, typename _Traits, typename _Alloc1>

void std::tr2::dynamic_bitset< _WordT, _Alloc >::_M_copy_to_string | ( | std::basic_string< _CharT, _Traits, _Alloc1 > & | __str,
|  | _CharT | __zero = _CharT('0'),
|  | _CharT | __one = _CharT('1') ) const
| inline

Definition at line 1112 of file dynamic_bitset.

## ◆ operator!=()

template<typename _WordT, typename _Alloc>

bool std::tr2::operator!= | ( | const dynamic_bitset< _WordT, _Alloc > & | __lhs,
|  | const dynamic_bitset< _WordT, _Alloc > & | __rhs )
| inline

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

Definition at line 1128 of file dynamic_bitset.

## ◆ operator&()

template<typename _WordT, typename _Alloc>

dynamic_bitset< _WordT, _Alloc > std::tr2::operator& | ( | const dynamic_bitset< _WordT, _Alloc > & | __x,
|  | const dynamic_bitset< _WordT, _Alloc > & | __y )
| inline

Global bitwise operations on bitsets.

Parameters

  __x | A bitset.
  __y | A bitset of the same size as __x.

Returns
  A new bitset.

These should be self-explanatory.

Definition at line 1163 of file dynamic_bitset.

## ◆ operator-()

template<typename _WordT, typename _Alloc>

dynamic_bitset< _WordT, _Alloc > std::tr2::operator- | ( | const dynamic_bitset< _WordT, _Alloc > & | __x,
|  | const dynamic_bitset< _WordT, _Alloc > & | __y )
| inline

Global bitwise operations on bitsets.

Parameters

  __x | A bitset.
  __y | A bitset of the same size as __x.

Returns
  A new bitset.

These should be self-explanatory.

Definition at line 1193 of file dynamic_bitset.

## ◆ operator<<()

template<typename _CharT, typename _Traits, typename _WordT, typename _Alloc>

std::basic_ostream< _CharT, _Traits > & std::tr2::operator<< | ( | std::basic_ostream< _CharT, _Traits > & | __os,
|  | const dynamic_bitset< _WordT, _Alloc > & | __x )
| inline

Stream output operator for dynamic_bitset.

Definition at line 1193 of file dynamic_bitset.

## ◆ operator<=()

template<typename _WordT, typename _Alloc>

bool std::tr2::operator<= | ( | const dynamic_bitset< _WordT, _Alloc > & | __lhs,
|  | const dynamic_bitset< _WordT, _Alloc > & | __rhs )
| inline

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

Definition at line 1133 of file dynamic_bitset.

## ◆ operator>()

template<typename _WordT, typename _Alloc>

bool std::tr2::operator> | ( | const dynamic_bitset< _WordT, _Alloc > & | __lhs,
|  | const dynamic_bitset< _WordT, _Alloc > & | __rhs )
| inline

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

Definition at line 1140 of file dynamic_bitset.

## ◆ operator>=()

template<typename _WordT, typename _Alloc>

bool std::tr2::operator>= | ( | const dynamic_bitset< _WordT, _Alloc > & | __lhs,
|  | const dynamic_bitset< _WordT, _Alloc > & | __rhs )
| inline

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

Definition at line 1146 of file dynamic_bitset.

## ◆ operator>>()

template<typename _CharT, typename _Traits, typename _WordT, typename _Alloc>

std::basic_istream< _CharT, _Traits > & std::tr2::operator>> | ( | std::basic_istream< _CharT, _Traits > & | __is,
|  | dynamic_bitset< _WordT, _Alloc > & | __x )

Stream input operator for dynamic_bitset.

Input will skip whitespace and only accept '0' and '1' characters. The dynamic_bitset will grow as necessary to hold the string of bits.

Definition at line 207 of file dynamic_bitset.tcc.

References std::basic_string< _CharT, _Traits, _Alloc >::empty(), std::basic_string< _CharT, _Traits, _Alloc >::push_back(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_string< _CharT, _Traits, _Alloc >::reserve(), std::tr2::dynamic_bitset< _WordT, _Alloc >::resize(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_string< _CharT, _Traits, _Alloc >::size(), std::tr2::dynamic_bitset< _WordT, _Alloc >::size(), and std::basic_ios< _CharT, _Traits >::widen().

## ◆ operator^()

template<typename _WordT, typename _Alloc>

dynamic_bitset< _WordT, _Alloc > std::tr2::operator^ | ( | const dynamic_bitset< _WordT, _Alloc > & | __x,
|  | const dynamic_bitset< _WordT, _Alloc > & | __y )
| inline

Global bitwise operations on bitsets.

Parameters

  __x | A bitset.
  __y | A bitset of the same size as __x.

Returns
  A new bitset.

These should be self-explanatory.

Definition at line 1183 of file dynamic_bitset.

## ◆ operator|()

template<typename _WordT, typename _Alloc>

dynamic_bitset< _WordT, _Alloc > std::tr2::operator| | ( | const dynamic_bitset< _WordT, _Alloc > & | __x,
|  | const dynamic_bitset< _WordT, _Alloc > & | __y )
| inline

Global bitwise operations on bitsets.

Parameters

  __x | A bitset.
  __y | A bitset of the same size as __x.

Returns
  A new bitset.

These should be self-explanatory.

Definition at line 1173 of file dynamic_bitset.