entt_traits: review to reduce the risk of ambiguous calls

This commit is contained in:
Michele Caini
2021-06-22 13:03:32 +02:00
parent a2d61dfaeb
commit 462bfea733
5 changed files with 36 additions and 33 deletions

View File

@@ -110,11 +110,11 @@ TEST(SparseSet, Contains) {
ASSERT_FALSE(set.contains(entt::tombstone));
// tombstones and null entities can trigger false positives
ASSERT_TRUE(set.contains(traits_type::to_type(entt::entity{1}, entt::null)));
ASSERT_TRUE(set.contains(traits_type::to_type(entt::entity{1}, entt::tombstone)));
ASSERT_TRUE(set.contains(traits_type::to_value(entt::entity{1}, entt::null)));
ASSERT_TRUE(set.contains(traits_type::to_value(entt::entity{1}, entt::tombstone)));
ASSERT_FALSE(set.contains(traits_type::to_type(entt::null, entt::entity{1})));
ASSERT_FALSE(set.contains(traits_type::to_type(entt::tombstone, entt::entity{1})));
ASSERT_FALSE(set.contains(traits_type::to_value(entt::null, entt::entity{1})));
ASSERT_FALSE(set.contains(traits_type::to_value(entt::tombstone, entt::entity{1})));
}
TEST(SparseSet, Move) {