Template Class BitSet#

Class Documentation#

template<uint64_t numBits_ = 64, bool stackAlloc_ = true>
class BitSet#

Public Types

template<uint64_t otherBits, bool otherStackAlloc> BitSetMerger = BitSet<(numBits_ > otherBits ? numBits_ :otherBits), stackAlloc_ &&otherStackAlloc >
using ElementType = uint64_t#
using StorageType = std::conditional_t<stackAlloc, std::array<ElementType, numElements>, ElementType*>#

Public Functions

inline BitSet()#
inline BitSet(const BitSet &other)#
BitSet(BitSet &&other) = default#
inline constexpr BitSet(uint64_t value)#
inline constexpr BitSet(const std::string &str, char zero = '0', char one = '1')#
BitSet &operator=(const BitSet &other) = default#
BitSet &operator=(BitSet &&other) = default#
inline ~BitSet()#
inline BitSet &set(uint64_t index, bool value)#
inline BitSet &set(uint64_t start, uint64_t end, bool value)#
inline bool get(uint64_t index) const#
inline bool any() const#
inline bool all() const#
inline bool none() const#
inline uint64_t first() const#
inline uint64_t popCount() const#
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline BitSet &operator|=(const BitSet<otherBits, otherStackAlloc> &other)#
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline BitSet &operator&=(const BitSet<otherBits, otherStackAlloc> &other)#
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline BitSet &operator^=(const BitSet<otherBits, otherStackAlloc> &other)#
inline BitSet &operator<<=(int64_t shift)#
inline BitSet &operator>>=(int64_t shift)#
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline auto operator|(const BitSet<otherBits, otherStackAlloc> &other) const -> BitSetMerger<otherBits, otherStackAlloc>#
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline auto operator&(const BitSet<otherBits, otherStackAlloc> &other) const -> BitSetMerger<otherBits, otherStackAlloc>#
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline auto operator^(const BitSet<otherBits, otherStackAlloc> &other) const -> BitSetMerger<otherBits, otherStackAlloc>#
inline BitSet operator<<(int64_t shift) const#
inline BitSet operator>>(int64_t shift) const#
inline BitSet operator~() const#
inline bool operator==(const BitSet &other) const#
inline const auto &data() const#
inline auto &data()#
template<typename T, typename Char, typename Ctx>
inline void str(const fmt::formatter<T, Char> &format, Ctx &ctx) const#

Public Members

friend BitSet< numBits_, !stackAlloc_ >

Public Static Attributes

static constexpr bool stackAlloc = stackAlloc_#
static constexpr uint64_t bitsPerElement = sizeof(ElementType) * 8#
static constexpr uint64_t numBits = numBits_#
static constexpr uint64_t numElements = (numBits + bitsPerElement - 1) / bitsPerElement#

Protected Functions

inline constexpr uint64_t highMask() const#
inline void zero()#
inline void init()#
inline void emptyInit()#