Skip to content

Commit

Permalink
fix: suppress compilation warning (#1684)
Browse files Browse the repository at this point in the history
Suppress false positive warning for type comparison by leveraging compile-time checks
  • Loading branch information
dudantas authored Oct 6, 2023
1 parent 1ac6d8a commit dbe353c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/kv/value_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ inline bool operator==(const ValueVariant &lhs, const ValueVariant &rhs) {
return b.contains(key) && value.get() == b.at(key).get();
});
}
return a == b;
// Compares a and b if types A and B are the same, at compile-time
if constexpr (std::is_same_v<A, B>) {
return a == b;
}
},
lhs, rhs
);
Expand Down

0 comments on commit dbe353c

Please sign in to comment.