diff --git a/TODO b/TODO index 2cafa529f..9e867b374 100644 --- a/TODO +++ b/TODO @@ -33,4 +33,3 @@ TODO * multi component registry::remove and some others? * range based registry::remove and some others? * nested groups: AB/ABC/ABCD/... (hints: sort, check functions) -* ::size_type - c'mon diff --git a/src/entt/entity/group.hpp b/src/entt/entity/group.hpp index c7ebb7b45..92643402c 100644 --- a/src/entt/entity/group.hpp +++ b/src/entt/entity/group.hpp @@ -93,9 +93,9 @@ class basic_group, get_t> { public: /*! @brief Underlying entity identifier. */ - using entity_type = typename sparse_set::entity_type; + using entity_type = Entity; /*! @brief Unsigned integer type. */ - using size_type = typename sparse_set::size_type; + using size_type = std::size_t; /*! @brief Input iterator type. */ using iterator_type = typename sparse_set::iterator_type; @@ -494,7 +494,7 @@ class basic_group, get_t, Owned, Other...> using component_iterator_type = decltype(std::declval>().begin()); // we could use pool_type *..., but vs complains about it and refuses to compile for unknown reasons (most likely a bug) - basic_group(const typename basic_registry::size_type *sz, storage> *owned, storage> *... other, storage> *... get) ENTT_NOEXCEPT + basic_group(const std::size_t *sz, storage> *owned, storage> *... other, storage> *... get) ENTT_NOEXCEPT : length{sz}, pools{owned, other..., get...} {} @@ -521,9 +521,9 @@ class basic_group, get_t, Owned, Other...> public: /*! @brief Underlying entity identifier. */ - using entity_type = typename sparse_set::entity_type; + using entity_type = Entity; /*! @brief Unsigned integer type. */ - using size_type = typename sparse_set::size_type; + using size_type = std::size_t; /*! @brief Input iterator type. */ using iterator_type = typename sparse_set::iterator_type; @@ -838,7 +838,7 @@ public: } private: - const typename basic_registry::size_type *length; + const size_type *length; const std::tuple *, pool_type *..., pool_type *...> pools; }; diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index f1aae9e9d..510f7f6a3 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -323,7 +323,7 @@ public: /*! @brief Underlying version type. */ using version_type = typename traits_type::version_type; /*! @brief Unsigned integer type. */ - using size_type = typename sparse_set::size_type; + using size_type = std::size_t; /*! @brief Default constructor. */ basic_registry() ENTT_NOEXCEPT = default; diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index d5f10d179..6c3aa2729 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -155,8 +155,8 @@ class basic_view, Component...> { } unchecked_type unchecked(const sparse_set *view) const ENTT_NOEXCEPT { + std::size_t pos{}; unchecked_type other{}; - typename unchecked_type::size_type pos{}; ((std::get *>(pools) == view ? nullptr : (other[pos++] = std::get *>(pools))), ...); return other; } diff --git a/src/entt/process/scheduler.hpp b/src/entt/process/scheduler.hpp index 6449ad0be..3a9ac4fbe 100644 --- a/src/entt/process/scheduler.hpp +++ b/src/entt/process/scheduler.hpp @@ -111,7 +111,7 @@ class scheduler { public: /*! @brief Unsigned integer type. */ - using size_type = typename std::vector::size_type; + using size_type = std::size_t; /*! @brief Default constructor. */ scheduler() ENTT_NOEXCEPT = default; diff --git a/src/entt/resource/cache.hpp b/src/entt/resource/cache.hpp index ecf5fc09e..c0a598246 100644 --- a/src/entt/resource/cache.hpp +++ b/src/entt/resource/cache.hpp @@ -26,12 +26,9 @@ namespace entt { * @tparam Resource Type of resources managed by a cache. */ template -class resource_cache { - using container_type = std::unordered_map>; - -public: +struct resource_cache { /*! @brief Unsigned integer type. */ - using size_type = typename container_type::size_type; + using size_type = std::size_t; /*! @brief Type of resources managed by a cache. */ using resource_type = ENTT_ID_TYPE; @@ -231,7 +228,7 @@ public: } private: - container_type resources; + std::unordered_map> resources; }; diff --git a/src/entt/resource/fwd.hpp b/src/entt/resource/fwd.hpp index e85fe6b17..8a2343671 100644 --- a/src/entt/resource/fwd.hpp +++ b/src/entt/resource/fwd.hpp @@ -10,7 +10,7 @@ namespace entt { /*! @class resource_cache */ template -class resource_cache; +struct resource_cache; /*! @class resource_handle */ template diff --git a/src/entt/signal/sigh.hpp b/src/entt/signal/sigh.hpp index 2f9e9c131..6c6db40b5 100644 --- a/src/entt/signal/sigh.hpp +++ b/src/entt/signal/sigh.hpp @@ -62,7 +62,7 @@ class sigh { public: /*! @brief Unsigned integer type. */ - using size_type = typename std::vector>::size_type; + using size_type = std::size_t; /*! @brief Sink type. */ using sink_type = entt::sink;