diff --git a/include/flatmemory/details/types/bitset.hpp b/include/flatmemory/details/types/bitset.hpp index 7e70ebb..730581a 100644 --- a/include/flatmemory/details/types/bitset.hpp +++ b/include/flatmemory/details/types/bitset.hpp @@ -919,6 +919,22 @@ class Builder> : public IBuilder>> unset_all(); } + // Set all bits + void set_all() + { + for (auto& value : m_blocks) + { + value = (m_default_bit_value) ? BitsetOperator::block_zeroes : BitsetOperator::block_ones; + } + } + + // Set all bits for a given default_bit_value + void set_all(bool default_bit_value) + { + m_default_bit_value = default_bit_value; + set_all(); + } + Builder& operator~() { m_default_bit_value = !m_default_bit_value;