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