Fix incorrect code in parallel_node_hash_set emplace. (#293)

* Fix incorrect code in `parallel_node_hash_set` emplace.

* Add test for issue #292.
This commit is contained in:
Gregory Popovitch
2025-11-26 16:06:44 -05:00
committed by GitHub
parent 4e410c7af3
commit fa5a89fe79
3 changed files with 37 additions and 20 deletions
+8
View File
@@ -105,6 +105,14 @@ TEST(THIS_TEST_NAME, MergeExtractInsert) {
EXPECT_THAT(set2, UnorderedElementsAre(Pointee(7), Pointee(23)));
}
TEST(THIS_TEST_NAME, Emplace) {
using Thing = std::tuple<size_t, double>;
phmap::THIS_HASH_SET<Thing> hs;
hs.emplace(Thing(0, 1.25));
hs.emplace(0, 1.3);
assert(hs.find(Thing(0, 1.3)) != hs.end());
}
} // namespace
} // namespace priv
} // namespace phmap