# bitset File Reference

## Detailed Description

This is a Standard C++ Library header.

Definition in file bitset.

Go to the source code of this file.

## Namespaces

- namespace std

## Defines

- #define _GLIBCXX_BITSET
- #define _GLIBCXX_BITSET_BITS_PER_WORD
- #define _GLIBCXX_BITSET_WORDS(__n)

## Functions

- template<size_t _Nb> bitset< _Nb > operator & (const bitset< _Nb > &__x, const bitset< _Nb > &__y)
- template<class _CharT, class _Traits, size_t _Nb> basic_ostream< _CharT, _Traits > & operator<< (basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
- template<class _CharT, class _Traits, size_t _Nb> basic_istream< _CharT, _Traits > & operator>> (basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
- template<size_t _Nb> bitset< _Nb > operator^ (const bitset< _Nb > &__x, const bitset< _Nb > &__y)
- template<size_t _Nb> bitset< _Nb > operator| (const bitset< _Nb > &__x, const bitset< _Nb > &__y)

## Function Documentation

bitset<_Nb> std::operator & | ( | const bitset< _Nb > & | __x,
|  | const bitset< _Nb > & | __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 bitset.

basic_istream<_CharT, _Traits>& std::operator>> | ( | basic_istream< _CharT, _Traits > & | __is,
|  | bitset< _Nb > & | __x
| ) |

Global I/O operators for bitsets.

Direct I/O between streams and bitsets is supported. Output is straightforward. Input will skip whitespace, only accept '0' and '1' characters, and will only extract as many digits as the bitset will hold.

Definition at line 1220 of file bitset.

References _M_copy_from_string(), ios_base::badbit, basic_string::empty(), ios_base::eofbit, ios_base::failbit, ios_base::goodbit, basic_string::push_back(), basic_string::reserve(), basic_streambuf::sbumpc(), and basic_streambuf::sputbackc().