Skip to content

Commit

Permalink
Fix other unused warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
  • Loading branch information
phprus committed Aug 6, 2022
1 parent 5374312 commit 3e4a210
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/gtl/bit_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class storage {

// -----------------------------------------------------------------------
template<vt flags, class F>
void visit_all(F f) {
void visit_all([[maybe_unused]] F f) {
size_t num_slots = slot_cnt(_sz);
if constexpr (flags & vt::false_) {
// set all bits to 0
Expand All @@ -320,7 +320,7 @@ class storage {
size_t slot;
for (slot=0; slot<num_slots-1; ++slot) {
const uint64_t s = _s[slot];
const auto fs = f(s);
[[maybe_unused]] const auto fs = f(s);
if constexpr (!(flags & vt::view)) {
if (s != fs)
_s[slot] = fs;
Expand All @@ -329,7 +329,7 @@ class storage {
}
const uint64_t m = mod(_sz) ? himask(_sz) : (uint64_t)0; // m has ones on the bits we don't want to change
const uint64_t s = _s[slot];
const auto fs = f(oor_bits<flags>(s, m));
[[maybe_unused]] const auto fs = f(oor_bits<flags>(s, m));
if constexpr (!(flags & vt::view))
if (s != fs)
_s[slot] = fs & ~m; // mask last returned value so we don't set bits past end
Expand Down

0 comments on commit 3e4a210

Please sign in to comment.