diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index 9ab671049..84edddbe2 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -61,11 +61,11 @@ class basic_storage: public basic_sparse_set { using underlying_type = basic_sparse_set; using traits_type = entt_traits; - template + template class storage_iterator final { friend class basic_storage; - using instance_type = std::conditional_t, std::vector>; + using instance_type = constness_as_t, Value>; using index_type = typename traits_type::difference_type; storage_iterator(instance_type &ref, const index_type idx) ENTT_NOEXCEPT @@ -74,9 +74,9 @@ class basic_storage: public basic_sparse_set { public: using difference_type = index_type; - using value_type = Type; - using pointer = std::conditional_t; - using reference = std::conditional_t; + using value_type = Value; + using pointer = value_type *; + using reference = value_type &; using iterator_category = std::random_access_iterator_tag; storage_iterator() ENTT_NOEXCEPT = default; @@ -185,9 +185,9 @@ public: /*! @brief Unsigned integer type. */ using size_type = std::size_t; /*! @brief Random access iterator type. */ - using iterator = storage_iterator; + using iterator = storage_iterator; /*! @brief Constant random access iterator type. */ - using const_iterator = storage_iterator; + using const_iterator = storage_iterator; /*! @brief Reverse iterator type. */ using reverse_iterator = Type *; /*! @brief Constant reverse iterator type. */