Browse Source

storage: reduce impact of entity_like, and prepare to fix it

skypjack 2 days ago
parent
commit
8cc2eb43b3
2 changed files with 4 additions and 4 deletions
  1. 1 1
      src/entt/entity/fwd.hpp
  2. 3 3
      src/entt/entity/storage.hpp

+ 1 - 1
src/entt/entity/fwd.hpp

@@ -50,7 +50,7 @@ struct component_traits;
 template<entity_like Entity = entity, typename = std::allocator<Entity>>
 class basic_sparse_set;
 
-template<typename Type, entity_like = entity, typename = std::allocator<Type>>
+template<typename Type, typename = entity, typename = std::allocator<Type>>
 class basic_storage;
 
 template<typename, typename>

+ 3 - 3
src/entt/entity/storage.hpp

@@ -206,7 +206,7 @@ private:
  * @tparam Entity A valid entity type.
  * @tparam Allocator Type of allocator used to manage memory and elements.
  */
-template<typename Type, entity_like Entity, typename Allocator>
+template<typename Type, typename Entity, typename Allocator>
 class basic_storage: public basic_sparse_set<Entity, typename std::allocator_traits<Allocator>::template rebind_alloc<Entity>> {
     using alloc_traits = std::allocator_traits<Allocator>;
     static_assert(std::is_same_v<typename alloc_traits::value_type, Type>, "Invalid value type");
@@ -773,7 +773,7 @@ private:
 };
 
 /*! @copydoc basic_storage */
-template<typename Type, entity_like Entity, typename Allocator>
+template<typename Type, typename Entity, typename Allocator>
 requires (component_traits<Type, Entity>::page_size == 0u)
 class basic_storage<Type, Entity, Allocator>
     : public basic_sparse_set<Entity, typename std::allocator_traits<Allocator>::template rebind_alloc<Entity>> {
@@ -956,7 +956,7 @@ public:
  * @tparam Entity A valid entity type.
  * @tparam Allocator Type of allocator used to manage memory and elements.
  */
-template<entity_like Entity, typename Allocator>
+template<typename Entity, typename Allocator>
 class basic_storage<Entity, Entity, Allocator>
     : public basic_sparse_set<Entity, Allocator> {
     using alloc_traits = std::allocator_traits<Allocator>;