mirror of
https://github.com/nlohmann/json.git
synced 2026-10-07 06:57:14 +00:00
Mark the unordered_set in the hash regression test const
clang-tidy's misc-const-correctness check flagged it: the set is never mutated after construction, only read via size(). Signed-off-by: Afonso Januário <afonso-januario@hotmail.com> Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
1 parent
23381929ff
commit
071f79b524
1 file changed
+1
-1
@@ -145,7 +145,7 @@ TEST_CASE("hash<nlohmann::json>")
|
||||
CHECK(std::hash<json> {}(json(-1)) == std::hash<json> {}(json(-1.0)));
|
||||
|
||||
// a std::unordered_set relies on this same consistency between == and hash
|
||||
std::unordered_set<json> numbers {json(0), json(static_cast<unsigned>(0)), json(0.0)};
|
||||
const std::unordered_set<json> numbers {json(0), json(static_cast<unsigned>(0)), json(0.0)};
|
||||
CHECK(numbers.size() == 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user