diff --git a/src/entt/entity/group.hpp b/src/entt/entity/group.hpp index 4631524c5..d2995256c 100644 --- a/src/entt/entity/group.hpp +++ b/src/entt/entity/group.hpp @@ -134,11 +134,11 @@ class basic_group, get_t, exclude_t> { static constexpr std::size_t index_of = type_list_index_v, type_list...>>; template - using storage_type = constness_as_t>::type, Comp>; + using storage_for = constness_as_t>::type, Comp>; - using basic_common_type = std::common_type_t::base_type...>; + using basic_common_type = std::common_type_t::base_type...>; - basic_group(basic_common_type &ref, storage_type &...gpool) noexcept + basic_group(basic_common_type &ref, storage_for &...gpool) noexcept : handler{&ref}, pools{&gpool...} {} @@ -154,7 +154,7 @@ public: /*! @brief Reversed iterator type. */ using reverse_iterator = typename base_type::reverse_iterator; /*! @brief Iterable group type. */ - using iterable = iterable_adaptor, get_t...>>>; + using iterable = iterable_adaptor, get_t...>>>; /*! @brief Default constructor to use to create empty, invalid groups. */ basic_group() noexcept @@ -489,7 +489,7 @@ public: private: base_type *const handler; - const std::tuple *...> pools; + const std::tuple *...> pools; }; /** @@ -534,9 +534,9 @@ class basic_group, get_t, exclude_t, type_list..., std::remove_const_t...>>; template - using storage_type = constness_as_t>::type, Comp>; + using storage_for = constness_as_t>::type, Comp>; - basic_group(const std::size_t &extent, storage_type &...opool, storage_type &...gpool) noexcept + basic_group(const std::size_t &extent, storage_for &...opool, storage_for &...gpool) noexcept : pools{&opool..., &gpool...}, length{&extent} {} @@ -546,13 +546,13 @@ public: /*! @brief Unsigned integer type. */ using size_type = std::size_t; /*! @brief Common type among all storage types. */ - using base_type = std::common_type_t::base_type..., typename storage_type::base_type...>; + using base_type = std::common_type_t::base_type..., typename storage_for::base_type...>; /*! @brief Random access iterator type. */ using iterator = typename base_type::iterator; /*! @brief Reversed iterator type. */ using reverse_iterator = typename base_type::reverse_iterator; /*! @brief Iterable group type. */ - using iterable = iterable_adaptor...>, get_t...>>>; + using iterable = iterable_adaptor...>, get_t...>>>; /*! @brief Default constructor to use to create empty, invalid groups. */ basic_group() noexcept @@ -846,7 +846,7 @@ public: } private: - const std::tuple *..., storage_type *...> pools; + const std::tuple *..., storage_for *...> pools; const size_type *const length; }; diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 5aa744bd3..0db9027df 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -222,7 +222,7 @@ class basic_registry { using basic_common_type = basic_sparse_set; template - using storage_type = constness_as_t>::type, Comp>; + using storage_for = constness_as_t>::type, Comp>; template struct group_handler; @@ -237,7 +237,7 @@ class basic_registry { void maybe_valid_if(basic_registry &owner, const Entity entt) { [[maybe_unused]] const auto cpools = std::forward_as_tuple(owner.assure()...); - const auto is_valid = ((std::is_same_v || std::get &>(cpools).contains(entt)) && ...) + const auto is_valid = ((std::is_same_v || std::get &>(cpools).contains(entt)) && ...) && ((std::is_same_v || owner.assure().contains(entt)) && ...) && ((std::is_same_v || !owner.assure().contains(entt)) && ...); @@ -248,7 +248,7 @@ class basic_registry { } else { if(is_valid && !(std::get<0>(cpools).index(entt) < current)) { const auto pos = current++; - (std::get &>(cpools).swap_elements(std::get &>(cpools).data()[pos], entt), ...); + (std::get &>(cpools).swap_elements(std::get &>(cpools).data()[pos], entt), ...); } } } @@ -259,7 +259,7 @@ class basic_registry { } else { if(const auto cpools = std::forward_as_tuple(owner.assure()...); std::get<0>(cpools).contains(entt) && (std::get<0>(cpools).index(entt) < current)) { const auto pos = --current; - (std::get &>(cpools).swap_elements(std::get &>(cpools).data()[pos], entt), ...); + (std::get &>(cpools).swap_elements(std::get &>(cpools).data()[pos], entt), ...); } } } @@ -279,12 +279,12 @@ class basic_registry { auto &&cpool = pools[id]; if(!cpool) { - cpool.reset(new storage_type{}); + cpool.reset(new storage_for{}); cpool->bind(forward_as_any(*this)); } ENTT_ASSERT(cpool->type() == type_id(), "Unexpected type"); - return static_cast &>(*cpool); + return static_cast &>(*cpool); } template @@ -293,10 +293,10 @@ class basic_registry { if(const auto it = pools.find(id); it != pools.cend()) { ENTT_ASSERT(it->second->type() == type_id(), "Unexpected type"); - return static_cast &>(*it->second); + return static_cast &>(*it->second); } - static storage_type placeholder{}; + static storage_for placeholder{}; return placeholder; } @@ -1227,9 +1227,9 @@ public: template [[nodiscard]] auto view(exclude_t = {}) { return basic_view{std::forward_as_tuple( - static_cast &>(assure>()), - static_cast &>(assure>())...), - std::forward_as_tuple(static_cast &>(assure>())...)}; + static_cast &>(assure>()), + static_cast &>(assure>())...), + std::forward_as_tuple(static_cast &>(assure>())...)}; } /** @@ -1334,7 +1334,7 @@ public: } } - return {handler->current, std::get> &>(cpools)..., std::get> &>(cpools)...}; + return {handler->current, std::get> &>(cpools)..., std::get> &>(cpools)...}; } /*! @copydoc group */ diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index b4493ed96..1ef9d4b02 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -193,7 +193,7 @@ class basic_view, exclude_t> { friend class basic_view; template - using storage_type = constness_as_t>::type, Comp>; + using storage_for = constness_as_t>::type, Comp>; [[nodiscard]] auto opaque_check() const noexcept { std::array other{}; @@ -242,11 +242,11 @@ public: /*! @brief Unsigned integer type. */ using size_type = std::size_t; /*! @brief Common type among all storage types. */ - using base_type = std::common_type_t::base_type...>; + using base_type = std::common_type_t::base_type...>; /*! @brief Bidirectional iterator type. */ using iterator = internal::view_iterator; /*! @brief Iterable view type. */ - using iterable = iterable_adaptor...>>; + using iterable = iterable_adaptor...>>; /*! @brief Default constructor to use to create empty, invalid views. */ basic_view() noexcept @@ -259,7 +259,7 @@ public: * @param component The storage for the types to iterate. * @param epool The storage for the types used to filter the view. */ - basic_view(storage_type &...component, storage_type &...epool) noexcept + basic_view(storage_for &...component, storage_for &...epool) noexcept : basic_view{std::forward_as_tuple(component...), std::forward_as_tuple(epool...)} {} /** @@ -267,7 +267,7 @@ public: * @param component The storage for the types to iterate. * @param epool The storage for the types used to filter the view. */ - basic_view(std::tuple &...> component, std::tuple &...> epool = {}) noexcept + basic_view(std::tuple &...> component, std::tuple &...> epool = {}) noexcept : pools{std::apply([](auto &...curr) { return std::make_tuple(&curr...); }, component)}, filter{std::apply([](auto &...curr) { return std::make_tuple(&curr...); }, epool)}, view{std::apply([](const auto &...curr) { return (std::min)({&static_cast(curr)...}, [](auto *lhs, auto *rhs) { return lhs->size() < rhs->size(); }); }, component)} {} @@ -280,7 +280,7 @@ public: template [[nodiscard]] basic_view use() const noexcept { basic_view other{*this}; - other.view = std::get *>(pools); + other.view = std::get *>(pools); return other; } @@ -311,7 +311,7 @@ public: */ template [[nodiscard]] decltype(auto) storage() const noexcept { - return *std::get *>(pools); + return *std::get *>(pools); } /** @@ -433,9 +433,9 @@ public: if constexpr(sizeof...(Comp) == 0) { return std::apply([entt](auto *...curr) { return std::tuple_cat(curr->get_as_tuple(entt)...); }, pools); } else if constexpr(sizeof...(Comp) == 1) { - return (std::get *>(pools)->get(entt), ...); + return (std::get *>(pools)->get(entt), ...); } else { - return std::tuple_cat(std::get *>(pools)->get_as_tuple(entt)...); + return std::tuple_cat(std::get *>(pools)->get_as_tuple(entt)...); } } @@ -512,8 +512,8 @@ public: } private: - std::tuple *...> pools; - std::tuple *...> filter; + std::tuple *...> pools; + std::tuple *...> filter; const base_type *view; }; @@ -544,7 +544,7 @@ class basic_view, exclude_t<>, std::void_t friend class basic_view; - using storage_type = constness_as_t>::type, Component>; + using storage_for = constness_as_t>::type, Component>; public: /*! @brief Underlying entity identifier. */ @@ -552,13 +552,13 @@ public: /*! @brief Unsigned integer type. */ using size_type = std::size_t; /*! @brief Common type among all storage types. */ - using base_type = typename storage_type::base_type; + using base_type = typename storage_for::base_type; /*! @brief Random access iterator type. */ using iterator = typename base_type::iterator; /*! @brief Reversed iterator type. */ using reverse_iterator = typename base_type::reverse_iterator; /*! @brief Iterable view type. */ - using iterable = decltype(std::declval().each()); + using iterable = decltype(std::declval().each()); /*! @brief Default constructor to use to create empty, invalid views. */ basic_view() noexcept @@ -570,14 +570,14 @@ public: * @brief Constructs a single-type view from a storage class. * @param ref The storage for the type to iterate. */ - basic_view(storage_type &ref) noexcept + basic_view(storage_for &ref) noexcept : basic_view{std::forward_as_tuple(ref)} {} /** * @brief Constructs a single-type view from a storage class. * @param ref The storage for the type to iterate. */ - basic_view(std::tuple ref, std::tuple<> = {}) noexcept + basic_view(std::tuple ref, std::tuple<> = {}) noexcept : pools{&std::get<0>(ref)}, filter{}, view{&std::get<0>(ref)} {} @@ -838,7 +838,7 @@ public: } private: - std::tuple pools; + std::tuple pools; std::tuple<> filter; const base_type *view; };