storage: use proper value type for entity storage

This commit is contained in:
Michele Caini
2023-02-10 09:37:13 +01:00
parent e65a8f2e5f
commit 62079908ce
2 changed files with 3 additions and 3 deletions

View File

@@ -971,7 +971,7 @@ public:
/*! @brief Base type. */
using base_type = basic_sparse_set<Entity, Allocator>;
/*! @brief Type of the objects assigned to entities. */
using value_type = void;
using value_type = Entity;
/*! @brief Component traits. */
using traits_type = component_traits<void>;
/*! @brief Underlying entity identifier. */
@@ -995,7 +995,7 @@ public:
* @param allocator The allocator to use.
*/
explicit basic_storage(const allocator_type &allocator)
: base_type{type_id<void>(), deletion_policy::swap_and_pop, allocator},
: base_type{type_id<value_type>(), deletion_policy::swap_and_pop, allocator},
length{} {}
/**

View File

@@ -8,7 +8,7 @@
TEST(StorageEntity, TypeAndPolicy) {
entt::storage<entt::entity> pool;
ASSERT_EQ(pool.type(), entt::type_id<void>());
ASSERT_EQ(pool.type(), entt::type_id<entt::entity>());
ASSERT_EQ(pool.policy(), entt::deletion_policy::swap_and_pop);
}