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::bitset< Nb >::reference Class Reference

This encapsulates the concept of a single bit. More...

#include <ubb.h>

Public Member Functions

 reference (bitset &b, size_t pos) noexcept
 ~reference () noexcept
reference & operator= (bool x) noexcept
reference & operator= (const reference &j) noexcept
bool operator~ () const noexcept
 operator bool () const noexcept
reference & flip () noexcept

Friends

class bitset

Detailed Description

template<size_t Nb>
class universal_bitset::bitset< Nb >::reference

This encapsulates the concept of a single bit.

An instance of this class is a proxy for an actual bit; this way the individual bit operations are done as faster word-size bitwise instructions.

Most users will never need to use this class directly; conversions to and from bool are automatic and should be transparent. Overloaded operators help to preserve the illusion.

(On a typical system, this bit reference is 64 times the size of an actual bit. Ha.)

Constructor & Destructor Documentation

◆ reference()

template<size_t Nb>
universal_bitset::bitset< Nb >::reference::reference ( bitset & b,
size_t pos )
inlinenoexcept

◆ ~reference()

template<size_t Nb>
universal_bitset::bitset< Nb >::reference::~reference ( )
inlinenoexcept

Member Function Documentation

◆ flip()

template<size_t Nb>
reference & universal_bitset::bitset< Nb >::reference::flip ( )
inlinenoexcept

◆ operator bool()

template<size_t Nb>
universal_bitset::bitset< Nb >::reference::operator bool ( ) const
inlinenoexcept

◆ operator=() [1/2]

template<size_t Nb>
reference & universal_bitset::bitset< Nb >::reference::operator= ( bool x)
inlinenoexcept

◆ operator=() [2/2]

template<size_t Nb>
reference & universal_bitset::bitset< Nb >::reference::operator= ( const reference & j)
inlinenoexcept

◆ operator~()

template<size_t Nb>
bool universal_bitset::bitset< Nb >::reference::operator~ ( ) const
inlinenoexcept

◆ bitset

template<size_t Nb>
friend class bitset
friend

The documentation for this class was generated from the following file:
  • /home/runner/work/universal/universal/include/sw/universal/internal/bitblock/ubb.h