Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
universal_bitset Namespace Reference

Classes

struct  BaseBitset
 Base class, general case. More...
struct  BaseBitset< 1 >
 Base class, specialization for a single word. More...
struct  BaseBitset< 0 >
 Base class, specialization for no storage (zero-length bitset). More...
struct  Sanitize
struct  Sanitize< 0 >
struct  Sanitize_val
struct  Sanitize_val< Nb, true >
class  bitset
 The bitset class represents a fixed-size sequence of bits. More...

Typedefs

typedef unsigned long WordT

Functions

template<size_t Nb>
bitset< Nb > operator& (const bitset< Nb > &x, const bitset< Nb > &y) noexcept
 Global bitwise operations on bitsets.
template<size_t Nb>
bitset< Nb > operator| (const bitset< Nb > &x, const bitset< Nb > &y) noexcept
template<size_t Nb>
bitset< Nb > operator^ (const bitset< Nb > &x, const bitset< Nb > &y) noexcept
template<class _CharT, class _Traits, size_t Nb>
std::basic_istream< _CharT, _Traits > & operator>> (std::basic_istream< _CharT, _Traits > &__is, bitset< Nb > &x)
 Global I/O operators for bitsets.
template<class _CharT, class _Traits, size_t Nb>
std::basic_ostream< _CharT, _Traits > & operator<< (std::basic_ostream< _CharT, _Traits > &os, const bitset< Nb > &x)

Typedef Documentation

◆ WordT

typedef unsigned long universal_bitset::WordT

Function Documentation

◆ operator&()

template<size_t Nb>
bitset< Nb > universal_bitset::operator& ( const bitset< Nb > & x,
const bitset< Nb > & y )
inlinenoexcept

Global bitwise operations on bitsets.

Parameters
xA bitset.
yA bitset of the same size as x.
Returns
A new bitset.

These should be self-explanatory.

◆ operator<<()

template<class _CharT, class _Traits, size_t Nb>
std::basic_ostream< _CharT, _Traits > & universal_bitset::operator<< ( std::basic_ostream< _CharT, _Traits > & os,
const bitset< Nb > & x )

◆ operator>>()

template<class _CharT, class _Traits, size_t Nb>
std::basic_istream< _CharT, _Traits > & universal_bitset::operator>> ( std::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.

◆ operator^()

template<size_t Nb>
bitset< Nb > universal_bitset::operator^ ( const bitset< Nb > & x,
const bitset< Nb > & y )
inlinenoexcept

◆ operator|()

template<size_t Nb>
bitset< Nb > universal_bitset::operator| ( const bitset< Nb > & x,
const bitset< Nb > & y )
inlinenoexcept