From 62246d8796421b4fade2b41f489ca8c0c6a841ca Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 14 Dec 2022 10:49:32 +0100 Subject: [PATCH] storage: avoid hiding basic_iterator type meber --- src/entt/entity/storage.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index 8f4f668ad..3b04e24e0 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -231,8 +231,9 @@ template class basic_storage: public basic_sparse_set::template rebind_alloc> { using alloc_traits = std::allocator_traits; static_assert(std::is_same_v, "Invalid value type"); - using underlying_type = basic_sparse_set>; using container_type = std::vector>; + using underlying_type = basic_sparse_set>; + using underlying_iterator = typename underlying_type::basic_iterator; static constexpr bool is_pinned_type_v = !(std::is_move_constructible_v && std::is_move_assignable_v); @@ -325,15 +326,12 @@ private: } protected: - /*! @brief Random access iterator type. */ - using basic_iterator = typename underlying_type::basic_iterator; - /** * @brief Erases entities from a sparse set. * @param first An iterator to the first element of the range of entities. * @param last An iterator past the last element of the range of entities. */ - void pop(basic_iterator first, basic_iterator last) override { + void pop(underlying_iterator first, underlying_iterator last) override { for(; first != last; ++first) { // cannot use first.index() because it would break with cross iterators auto &elem = element_at(base_type::index(*first)); @@ -358,7 +356,7 @@ protected: * @param force_back Force back insertion. * @return Iterator pointing to the emplaced element. */ - basic_iterator try_emplace([[maybe_unused]] const Entity entt, [[maybe_unused]] const bool force_back, const void *value) override { + underlying_iterator try_emplace([[maybe_unused]] const Entity entt, [[maybe_unused]] const bool force_back, const void *value) override { if(value) { if constexpr(std::is_copy_constructible_v) { return emplace_element(entt, force_back, *static_cast(value));