template<class T>
nCine::BitSet class

A sequence of bits to be manipulated with logical operators.

Constructors, destructors, conversion operators

BitSet()
BitSet(T value) explicit

Public functions

auto operator==(const BitSet& other) const -> bool
auto operator!=(const BitSet& other) const -> bool
auto test(unsigned int pos) const -> bool
auto all() const -> bool
auto any() const -> bool
auto none() const -> bool
auto count() const -> unsigned int
auto size() const -> unsigned int
auto operator&=(const BitSet& other) -> BitSet&
auto operator|=(const BitSet& other) -> BitSet&
auto operator^=(const BitSet& other) -> BitSet&
auto operator~() const -> BitSet
auto operator<<=(unsigned int pos) -> BitSet&
auto operator>>=(unsigned int pos) -> BitSet&
auto operator<<(unsigned int pos) const -> BitSet
auto operator>>(unsigned int pos) const -> BitSet
void set()
Sets all bits in the bitset.
void set(unsigned int pos)
Sets the bit at the specified position.
void set(unsigned int pos, bool value)
Sets the bit at the specified position with the specified value.
void reset()
Resets all bits in the bitset.
void reset(unsigned int pos)
Resets the bit at the specified position.
void flip(unsigned int pos)
Flips the bit at the specified position.
auto count() const -> unsigned int
auto count() const -> unsigned int
auto count() const -> unsigned int
auto count() const -> unsigned int

Friends

auto operator&(const BitSet& lhs, const BitSet& rhs) -> BitSet
auto operator|(const BitSet& lhs, const BitSet& rhs) -> BitSet
auto operator^(const BitSet& lhs, const BitSet& rhs) -> BitSet

Function documentation

template<class T>
bool nCine::BitSet<T>::test(unsigned int pos) const

Returns True if the bit at the specified position is set

template<class T>
bool nCine::BitSet<T>::all() const

Returns True if all bits are set

template<class T>
bool nCine::BitSet<T>::any() const

Returns True if at least one bit is set

template<class T>
bool nCine::BitSet<T>::none() const

Returns True if all bits are not set

template<class T>
unsigned int nCine::BitSet<T>::count() const

Returns The number of bits that are set

template<class T>
unsigned int nCine::BitSet<T>::size() const

Returns The total number of bits in the bitset