Quellcode durchsuchen

sparse_set/storage: minor changes to reuse type members

Michele Caini vor 3 Jahren
Ursprung
Commit
f0613b1c6c
2 geänderte Dateien mit 10 neuen und 10 gelöschten Zeilen
  1. 2 2
      src/entt/entity/sparse_set.hpp
  2. 8 8
      src/entt/entity/storage.hpp

+ 2 - 2
src/entt/entity/sparse_set.hpp

@@ -316,14 +316,14 @@ protected:
 public:
     /*! @brief Entity traits. */
     using traits_type = entt_traits<Entity>;
-    /*! @brief Allocator type. */
-    using allocator_type = Allocator;
     /*! @brief Underlying entity identifier. */
     using entity_type = typename traits_type::value_type;
     /*! @brief Underlying version type. */
     using version_type = typename traits_type::version_type;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
+    /*! @brief Allocator type. */
+    using allocator_type = Allocator;
     /*! @brief Pointer type to contained entities. */
     using pointer = typename packed_container_type::const_pointer;
     /*! @brief Random access iterator type. */

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

@@ -375,16 +375,16 @@ protected:
 public:
     /*! @brief Base type. */
     using base_type = underlying_type;
-    /*! @brief Component traits. */
-    using traits_type = component_traits<Type>;
-    /*! @brief Allocator type. */
-    using allocator_type = Allocator;
     /*! @brief Type of the objects assigned to entities. */
     using value_type = Type;
+    /*! @brief Component traits. */
+    using traits_type = component_traits<value_type>;
     /*! @brief Underlying entity identifier. */
     using entity_type = Entity;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
+    /*! @brief Allocator type. */
+    using allocator_type = Allocator;
     /*! @brief Pointer type to contained elements. */
     using pointer = typename container_type::pointer;
     /*! @brief Constant pointer type to contained elements. */
@@ -749,16 +749,16 @@ class basic_storage<Type, Entity, Allocator, std::enable_if_t<component_traits<T
 public:
     /*! @brief Base type. */
     using base_type = basic_sparse_set<Entity, typename alloc_traits::template rebind_alloc<Entity>>;
-    /*! @brief Component traits. */
-    using traits_type = component_traits<Type>;
-    /*! @brief Allocator type. */
-    using allocator_type = Allocator;
     /*! @brief Type of the objects assigned to entities. */
     using value_type = Type;
+    /*! @brief Component traits. */
+    using traits_type = component_traits<value_type>;
     /*! @brief Underlying entity identifier. */
     using entity_type = Entity;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
+    /*! @brief Allocator type. */
+    using allocator_type = Allocator;
     /*! @brief Extended iterable storage proxy. */
     using iterable = iterable_adaptor<internal::extended_storage_iterator<typename base_type::iterator>>;
     /*! @brief Constant extended iterable storage proxy. */