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(std::uint32_t pos) const -> bool
auto all() const -> bool
auto any() const -> bool
auto none() const -> bool
auto count() const -> std::uint32_t
auto size() const -> std::uint32_t
auto operator&=(const BitSet& other) -> BitSet&
auto operator|=(const BitSet& other) -> BitSet&
auto operator^=(const BitSet& other) -> BitSet&
auto operator~() const -> BitSet
auto operator<<=(std::uint32_t pos) -> BitSet&
auto operator>>=(std::uint32_t pos) -> BitSet&
auto operator<<(std::uint32_t pos) const -> BitSet
auto operator>>(std::uint32_t pos) const -> BitSet
void set()
Sets all bits in the bitset.
void set(std::uint32_t pos)
Sets the bit at the specified position.
void set(std::uint32_t pos, bool value)
Sets the bit at the specified position with the specified value.
void reset()
Resets all bits in the bitset.
void reset(std::uint32_t pos)
Resets the bit at the specified position.
void flip(std::uint32_t pos)
Flips the bit at the specified position.
auto count() const -> std::uint32_t
auto count() const -> std::uint32_t
auto count() const -> std::uint32_t
auto count() const -> std::uint32_t

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(std::uint32_t 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>
std::uint32_t nCine::BitSet<T>::count() const

Returns The number of bits that are set

template<class T>
std::uint32_t nCine::BitSet<T>::size() const

Returns The total number of bits in the bitset