diff --git a/src/lib/utils/bitvector.h b/src/lib/utils/bitvector.h index f1c975db236..694a76ae147 100644 --- a/src/lib/utils/bitvector.h +++ b/src/lib/utils/bitvector.h @@ -434,7 +434,8 @@ class bitvector_base final { * Sets all currently allocated bits. */ bitvector_base& set() { - full_range_operation([](std::unsigned_integral auto block) -> decltype(block) { return ~0; }, *this); + full_range_operation([](std::unsigned_integral auto block) -> decltype(block) { return ~decltype(block)(0); }, + *this); zero_unused_bits(); return *this; } @@ -453,7 +454,8 @@ class bitvector_base final { * Unsets all currently allocated bits. */ bitvector_base& unset() { - full_range_operation([](std::unsigned_integral auto block) -> decltype(block) { return 0; }, *this); + full_range_operation([](std::unsigned_integral auto block) -> decltype(block) { return decltype(block)(0); }, + *this); return *this; }