1
0
Michele Caini 2 жил өмнө
parent
commit
e53af7bef7

+ 4 - 3
src/entt/entity/registry.hpp

@@ -256,13 +256,14 @@ class basic_registry {
         auto &cpool = pools[id];
 
         if(!cpool) {
-            using alloc_type = typename storage_for_type<std::remove_const_t<Type>>::allocator_type;
+            using storage_type = storage_for_type<std::remove_const_t<Type>>;
+            using alloc_type = typename storage_type::allocator_type;
 
             if constexpr(std::is_same_v<Type, void> && !std::is_constructible_v<alloc_type, allocator_type>) {
                 // std::allocator<void> has no cross constructors (waiting for C++20)
-                cpool = std::allocate_shared<storage_for_type<std::remove_const_t<Type>>>(get_allocator(), alloc_type{});
+                cpool = std::allocate_shared<storage_type>(get_allocator(), alloc_type{});
             } else {
-                cpool = std::allocate_shared<storage_for_type<std::remove_const_t<Type>>>(get_allocator(), get_allocator());
+                cpool = std::allocate_shared<storage_type>(get_allocator(), get_allocator());
             }
 
             cpool->bind(forward_as_any(*this));