diff --git a/src/bm.h b/src/bm.h index 5236b2c6..fe645991 100644 --- a/src/bm.h +++ b/src/bm.h @@ -1270,13 +1270,13 @@ class bvector \param free_mem if "true" (default) bvector frees the memory, otherwise sets blocks to 0. */ - void clear(bool free_mem = true) { blockman_.set_all_zero(free_mem); } + void clear(bool free_mem = true) BMNOEXCEPT; /*! \brief Clears every bit in the bitvector. \return *this; */ - bvector& reset() { clear(true); return *this; } + bvector& reset() BMNOEXCEPT { clear(true); return *this; } /*! \brief Flips bit n @@ -4121,6 +4121,20 @@ void bvector::keep(const size_type* ids, size_type ids_size, // ----------------------------------------------------------------------- +template +void bvector::clear(bool free_mem) BMNOEXCEPT +{ + if (is_ro()) + { + BM_ASSERT(free_mem); + blockman_.destroy_arena(); + } + else + blockman_.set_all_zero(free_mem); +} + +// ----------------------------------------------------------------------- + template void bvector::clear(const size_type* ids, size_type ids_size, bm::sort_order so)