瀏覽代碼

entity: cleanup

skypjack 3 月之前
父節點
當前提交
06df4003e8

+ 6 - 6
src/entt/entity/entity.hpp

@@ -67,11 +67,11 @@ class basic_entt_traits {
 
 public:
     /*! @brief Value type. */
-    using value_type = typename Traits::value_type;
+    using value_type = Traits::value_type;
     /*! @brief Underlying entity type. */
-    using entity_type = typename Traits::entity_type;
+    using entity_type = Traits::entity_type;
     /*! @brief Underlying version type. */
-    using version_type = typename Traits::version_type;
+    using version_type = Traits::version_type;
 
     /*! @brief Entity mask size. */
     static constexpr entity_type entity_mask = Traits::entity_mask;
@@ -175,7 +175,7 @@ struct entt_traits: basic_entt_traits<internal::entt_traits<Type>> {
  * @return The integral representation of the given value.
  */
 template<typename Entity>
-[[nodiscard]] constexpr typename entt_traits<Entity>::entity_type to_integral(const Entity value) noexcept {
+[[nodiscard]] constexpr entt_traits<Entity>::entity_type to_integral(const Entity value) noexcept {
     return entt_traits<Entity>::to_integral(value);
 }
 
@@ -186,7 +186,7 @@ template<typename Entity>
  * @return The integral representation of the entity part.
  */
 template<typename Entity>
-[[nodiscard]] constexpr typename entt_traits<Entity>::entity_type to_entity(const Entity value) noexcept {
+[[nodiscard]] constexpr entt_traits<Entity>::entity_type to_entity(const Entity value) noexcept {
     return entt_traits<Entity>::to_entity(value);
 }
 
@@ -197,7 +197,7 @@ template<typename Entity>
  * @return The integral representation of the version part.
  */
 template<typename Entity>
-[[nodiscard]] constexpr typename entt_traits<Entity>::version_type to_version(const Entity value) noexcept {
+[[nodiscard]] constexpr entt_traits<Entity>::version_type to_version(const Entity value) noexcept {
     return entt_traits<Entity>::to_version(value);
 }
 

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

@@ -247,7 +247,7 @@ struct storage_type<reactive, Entity, Allocator> {
  * @tparam Args Arguments to forward.
  */
 template<typename... Args>
-using storage_type_t = typename storage_type<Args...>::type;
+using storage_type_t = storage_type<Args...>::type;
 
 /**
  * Type-to-storage conversion utility that preserves constness.
@@ -266,7 +266,7 @@ struct storage_for {
  * @tparam Args Arguments to forward.
  */
 template<typename... Args>
-using storage_for_t = typename storage_for<Args...>::type;
+using storage_for_t = storage_for<Args...>::type;
 
 /**
  * @brief Alias declaration for the most common use case.

+ 10 - 10
src/entt/entity/group.hpp

@@ -101,7 +101,7 @@ struct group_descriptor {
 
 template<typename Type, std::size_t Owned, std::size_t Get, std::size_t Exclude>
 class group_handler final: public group_descriptor {
-    using entity_type = typename Type::entity_type;
+    using entity_type = Type::entity_type;
 
     void swap_elements(const std::size_t pos, const entity_type entt) {
         for(size_type next{}; next < Owned; ++next) {
@@ -131,14 +131,14 @@ class group_handler final: public group_descriptor {
 
     void common_setup() {
         // we cannot iterate backwards because we want to leave behind valid entities in case of owned types
-        for(auto first = pools[0u]->rbegin(), last = first + static_cast<typename decltype(pools)::difference_type>(pools[0u]->size()); first != last; ++first) {
+        for(auto first = pools[0u]->rbegin(), last = first + static_cast<decltype(pools)::difference_type>(pools[0u]->size()); first != last; ++first) {
             push_on_construct(*first);
         }
     }
 
 public:
     using common_type = Type;
-    using size_type = typename Type::size_type;
+    using size_type = Type::size_type;
 
     template<typename... OGType, typename... EType>
     group_handler(std::tuple<OGType &...> ogpool, std::tuple<EType &...> epool)
@@ -180,7 +180,7 @@ private:
 
 template<typename Type, std::size_t Get, std::size_t Exclude>
 class group_handler<Type, 0u, Get, Exclude> final: public group_descriptor {
-    using entity_type = typename Type::entity_type;
+    using entity_type = Type::entity_type;
 
     void push_on_construct(const entity_type entt) {
         if(!elem.contains(entt)
@@ -281,7 +281,7 @@ class basic_group;
 template<typename... Get, typename... Exclude>
 class basic_group<owned_t<>, get_t<Get...>, exclude_t<Exclude...>> {
     using base_type = std::common_type_t<typename Get::base_type..., typename Exclude::base_type...>;
-    using underlying_type = typename base_type::entity_type;
+    using underlying_type = base_type::entity_type;
 
     template<typename Type>
     static constexpr std::size_t index_of = type_list_index_v<std::remove_const_t<Type>, type_list<typename Get::element_type..., typename Exclude::element_type...>>;
@@ -302,9 +302,9 @@ public:
     /*! @brief Common type among all storage types. */
     using common_type = base_type;
     /*! @brief Random access iterator type. */
-    using iterator = typename common_type::iterator;
+    using iterator = common_type::iterator;
     /*! @brief Reverse iterator type. */
-    using reverse_iterator = typename common_type::reverse_iterator;
+    using reverse_iterator = common_type::reverse_iterator;
     /*! @brief Iterable group type. */
     using iterable = iterable_adaptor<internal::extended_group_iterator<iterator, owned_t<>, get_t<Get...>>>;
     /*! @brief Group handler type. */
@@ -697,7 +697,7 @@ class basic_group<owned_t<Owned...>, get_t<Get...>, exclude_t<Exclude...>> {
     static_assert(((Owned::storage_policy != deletion_policy::in_place) && ...), "Groups do not support in-place delete");
 
     using base_type = std::common_type_t<typename Owned::base_type..., typename Get::base_type..., typename Exclude::base_type...>;
-    using underlying_type = typename base_type::entity_type;
+    using underlying_type = base_type::entity_type;
 
     template<typename Type>
     static constexpr std::size_t index_of = type_list_index_v<std::remove_const_t<Type>, type_list<typename Owned::element_type..., typename Get::element_type..., typename Exclude::element_type...>>;
@@ -718,9 +718,9 @@ public:
     /*! @brief Common type among all storage types. */
     using common_type = base_type;
     /*! @brief Random access iterator type. */
-    using iterator = typename common_type::iterator;
+    using iterator = common_type::iterator;
     /*! @brief Reverse iterator type. */
-    using reverse_iterator = typename common_type::reverse_iterator;
+    using reverse_iterator = common_type::reverse_iterator;
     /*! @brief Iterable group type. */
     using iterable = iterable_adaptor<internal::extended_group_iterator<iterator, owned_t<Owned...>, get_t<Get...>>>;
     /*! @brief Group handler type. */

+ 4 - 4
src/entt/entity/handle.hpp

@@ -22,10 +22,10 @@ class handle_storage_iterator final {
     friend class handle_storage_iterator;
 
     using underlying_type = std::remove_reference_t<typename It::value_type::second_type>;
-    using entity_type = typename underlying_type::entity_type;
+    using entity_type = underlying_type::entity_type;
 
 public:
-    using value_type = typename std::iterator_traits<It>::value_type;
+    using value_type = std::iterator_traits<It>::value_type;
     using pointer = input_iterator_pointer<value_type>;
     using reference = value_type;
     using difference_type = std::ptrdiff_t;
@@ -107,9 +107,9 @@ public:
     /*! @brief Type of registry accepted by the handle. */
     using registry_type = Registry;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename traits_type::value_type;
+    using entity_type = traits_type::value_type;
     /*! @brief Underlying version type. */
-    using version_type = typename traits_type::version_type;
+    using version_type = traits_type::version_type;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
     /*! @brief Iterable handle type. */

+ 4 - 4
src/entt/entity/helper.hpp

@@ -29,7 +29,7 @@ public:
     /*! @brief Type of registry to convert. */
     using registry_type = Registry;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename registry_type::entity_type;
+    using entity_type = registry_type::entity_type;
 
     /**
      * @brief Constructs a converter for a given registry.
@@ -72,7 +72,7 @@ public:
     /*! @brief Type of registry to convert. */
     using registry_type = Registry;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename registry_type::entity_type;
+    using entity_type = registry_type::entity_type;
 
     /**
      * @brief Constructs a converter for a given registry.
@@ -123,7 +123,7 @@ void invoke(Registry &reg, const typename Registry::entity_type entt) {
  * @return The entity associated with the given element.
  */
 template<typename... Args>
-typename basic_storage<Args...>::entity_type to_entity(const basic_storage<Args...> &storage, const typename basic_storage<Args...>::value_type &instance) {
+basic_storage<Args...>::entity_type to_entity(const basic_storage<Args...> &storage, const typename basic_storage<Args...>::value_type &instance) {
     using traits_type = component_traits<typename basic_storage<Args...>::value_type, typename basic_storage<Args...>::entity_type>;
     static_assert(traits_type::page_size != 0u, "Unexpected page size");
     const auto *page = storage.raw();
@@ -131,7 +131,7 @@ typename basic_storage<Args...>::entity_type to_entity(const basic_storage<Args.
     // NOLINTBEGIN(cppcoreguidelines-pro-bounds-pointer-arithmetic)
     for(std::size_t pos{}, count = storage.size(); pos < count; pos += traits_type::page_size, ++page) {
         if(const auto dist = (std::addressof(instance) - *page); dist >= 0 && dist < static_cast<decltype(dist)>(traits_type::page_size)) {
-            return *(static_cast<const typename basic_storage<Args...>::base_type &>(storage).rbegin() + static_cast<decltype(dist)>(pos) + dist);
+            return *(static_cast<const basic_storage<Args...>::base_type &>(storage).rbegin() + static_cast<decltype(dist)>(pos) + dist);
         }
     }
     // NOLINTEND(cppcoreguidelines-pro-bounds-pointer-arithmetic)

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

@@ -60,7 +60,7 @@ class basic_sigh_mixin final: public Type {
 
     using basic_registry_type = basic_registry<typename owner_type::entity_type, typename owner_type::allocator_type>;
     using sigh_type = sigh<void(owner_type &, const typename underlying_type::entity_type), typename underlying_type::allocator_type>;
-    using underlying_iterator = typename underlying_type::base_type::basic_iterator;
+    using underlying_iterator = underlying_type::base_type::basic_iterator;
 
     static_assert(std::is_base_of_v<basic_registry_type, owner_type>, "Invalid registry type");
 
@@ -90,7 +90,7 @@ private:
                     destruction.publish(reg, underlying_type::base_type::operator[](pos));
                 }
             } else {
-                for(auto entt: static_cast<typename underlying_type::base_type &>(*this)) {
+                for(auto entt: static_cast<underlying_type::base_type &>(*this)) {
                     if constexpr(underlying_type::storage_policy == deletion_policy::in_place) {
                         if(entt != tombstone) {
                             destruction.publish(reg, entt);
@@ -105,7 +105,7 @@ private:
         underlying_type::pop_all();
     }
 
-    underlying_iterator try_emplace(const typename underlying_type::entity_type entt, const bool force_back, const void *value) final {
+    underlying_iterator try_emplace(const underlying_type::entity_type entt, const bool force_back, const void *value) final {
         const auto it = underlying_type::try_emplace(entt, force_back, value);
 
         if(auto &reg = owner_or_assert(); it != underlying_type::base_type::end()) {
@@ -129,9 +129,9 @@ private:
 
 public:
     /*! @brief Allocator type. */
-    using allocator_type = typename underlying_type::allocator_type;
+    using allocator_type = underlying_type::allocator_type;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename underlying_type::entity_type;
+    using entity_type = underlying_type::entity_type;
     /*! @brief Expected registry type. */
     using registry_type = owner_type;
 
@@ -402,7 +402,7 @@ class basic_reactive_mixin final: public Type {
         return static_cast<owner_type &>(*owner);
     }
 
-    void emplace_element(const Registry &, typename underlying_type::entity_type entity) {
+    void emplace_element(const Registry &, underlying_type::entity_type entity) {
         if(!underlying_type::contains(entity)) {
             underlying_type::emplace(entity);
         }
@@ -423,9 +423,9 @@ private:
 
 public:
     /*! @brief Allocator type. */
-    using allocator_type = typename underlying_type::allocator_type;
+    using allocator_type = underlying_type::allocator_type;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename underlying_type::entity_type;
+    using entity_type = underlying_type::entity_type;
     /*! @brief Expected registry type. */
     using registry_type = owner_type;
 

+ 1 - 1
src/entt/entity/organizer.hpp

@@ -181,7 +181,7 @@ public:
     /*! Basic registry type. */
     using registry_type = Registry;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename registry_type::entity_type;
+    using entity_type = registry_type::entity_type;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
     /*! @brief Raw task function type. */

+ 9 - 9
src/entt/entity/registry.hpp

@@ -158,7 +158,7 @@ template<typename Lhs, typename Rhs>
 template<typename Allocator>
 class registry_context {
     using alloc_traits = std::allocator_traits<Allocator>;
-    using allocator_type = typename alloc_traits::template rebind_alloc<std::pair<const id_type, basic_any<0u>>>;
+    using allocator_type = alloc_traits::template rebind_alloc<std::pair<const id_type, basic_any<0u>>>;
 
 public:
     explicit registry_context(const allocator_type &allocator)
@@ -296,9 +296,9 @@ public:
     /*! @brief Allocator type. */
     using allocator_type = Allocator;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename traits_type::value_type;
+    using entity_type = traits_type::value_type;
     /*! @brief Underlying version type. */
-    using version_type = typename traits_type::version_type;
+    using version_type = traits_type::version_type;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
     /*! @brief Common type among all storage types. */
@@ -315,7 +315,7 @@ public:
      * @tparam Type Storage value type, eventually const.
      */
     template<typename Type>
-    using storage_for_type = typename storage_for<Type, Entity, typename alloc_traits::template rebind_alloc<std::remove_const_t<Type>>>::type;
+    using storage_for_type = storage_for<Type, Entity, typename alloc_traits::template rebind_alloc<std::remove_const_t<Type>>>::type;
 
     /*! @brief Default constructor. */
     basic_registry()
@@ -534,7 +534,7 @@ public:
      */
     version_type destroy(const entity_type entt) {
         for(size_type pos = pools.size(); pos != 0u; --pos) {
-            pools.begin()[static_cast<typename pool_container_type::difference_type>(pos - 1u)].second->remove(entt);
+            pools.begin()[static_cast<pool_container_type::difference_type>(pos - 1u)].second->remove(entt);
         }
 
         entities.erase(entt);
@@ -571,7 +571,7 @@ public:
     template<typename It>
     void destroy(It first, It last) {
         const auto to = entities.sort_as(first, last);
-        const auto from = entities.cend() - static_cast<typename common_type::difference_type>(entities.free_list());
+        const auto from = entities.cend() - static_cast<common_type::difference_type>(entities.free_list());
 
         for(auto &&curr: pools) {
             curr.second->remove(from, to);
@@ -971,7 +971,7 @@ public:
     void clear() {
         if constexpr(sizeof...(Type) == 0u) {
             for(size_type pos = pools.size(); pos; --pos) {
-                pools.begin()[static_cast<typename pool_container_type::difference_type>(pos - 1u)].second->clear();
+                pools.begin()[static_cast<pool_container_type::difference_type>(pos - 1u)].second->clear();
             }
 
             const auto elem = entities.each();
@@ -1095,7 +1095,7 @@ public:
     basic_group<owned_t<storage_for_type<Owned>...>, get_t<storage_for_type<Get>...>, exclude_t<storage_for_type<Exclude>...>>
     group(get_t<Get...> = get_t{}, exclude_t<Exclude...> = exclude_t{}) {
         using group_type = basic_group<owned_t<storage_for_type<Owned>...>, get_t<storage_for_type<Get>...>, exclude_t<storage_for_type<Exclude>...>>;
-        using handler_type = typename group_type::handler;
+        using handler_type = group_type::handler;
 
         if(auto it = groups.find(group_type::group_id()); it != groups.cend()) {
             return {*std::static_pointer_cast<handler_type>(it->second)};
@@ -1119,7 +1119,7 @@ public:
     [[nodiscard]] basic_group<owned_t<storage_for_type<const Owned>...>, get_t<storage_for_type<const Get>...>, exclude_t<storage_for_type<const Exclude>...>>
     group_if_exists(get_t<Get...> = get_t{}, exclude_t<Exclude...> = exclude_t{}) const {
         using group_type = basic_group<owned_t<storage_for_type<const Owned>...>, get_t<storage_for_type<const Get>...>, exclude_t<storage_for_type<const Exclude>...>>;
-        using handler_type = typename group_type::handler;
+        using handler_type = group_type::handler;
 
         if(auto it = groups.find(group_type::group_id()); it != groups.cend()) {
             return {*std::static_pointer_cast<handler_type>(it->second)};

+ 6 - 6
src/entt/entity/runtime_view.hpp

@@ -16,7 +16,7 @@ namespace internal {
 
 template<typename Set>
 class runtime_view_iterator final {
-    using iterator_type = typename Set::iterator;
+    using iterator_type = Set::iterator;
     using iterator_traits = std::iterator_traits<iterator_type>;
 
     [[nodiscard]] bool valid() const {
@@ -26,10 +26,10 @@ class runtime_view_iterator final {
     }
 
 public:
-    using value_type = typename iterator_traits::value_type;
-    using pointer = typename iterator_traits::pointer;
-    using reference = typename iterator_traits::reference;
-    using difference_type = typename iterator_traits::difference_type;
+    using value_type = iterator_traits::value_type;
+    using pointer = iterator_traits::pointer;
+    using reference = iterator_traits::reference;
+    using difference_type = iterator_traits::difference_type;
     using iterator_category = std::bidirectional_iterator_tag;
 
     constexpr runtime_view_iterator() noexcept
@@ -135,7 +135,7 @@ public:
     /*! @brief Allocator type. */
     using allocator_type = Allocator;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename Type::entity_type;
+    using entity_type = Type::entity_type;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
     /*! @brief Signed integer type. */

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

@@ -52,7 +52,7 @@ public:
     /*! Basic registry type. */
     using registry_type = Registry;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename registry_type::entity_type;
+    using entity_type = registry_type::entity_type;
 
     /**
      * @brief Constructs an instance that is bound to a given registry.
@@ -95,10 +95,10 @@ public:
         if(const auto *storage = reg->template storage<Type>(id); storage) {
             const typename registry_type::common_type &base = *storage;
 
-            archive(static_cast<typename traits_type::entity_type>(storage->size()));
+            archive(static_cast<traits_type::entity_type>(storage->size()));
 
             if constexpr(std::is_same_v<Type, entity_type>) {
-                archive(static_cast<typename traits_type::entity_type>(storage->free_list()));
+                archive(static_cast<traits_type::entity_type>(storage->free_list()));
 
                 for(auto first = base.rbegin(), last = base.rend(); first != last; ++first) {
                     archive(*first);
@@ -141,7 +141,7 @@ public:
         static_assert(!std::is_same_v<Type, entity_type>, "Entity types not supported");
 
         if(const auto *storage = reg->template storage<Type>(id); storage && !storage->empty()) {
-            archive(static_cast<typename traits_type::entity_type>(std::distance(first, last)));
+            archive(static_cast<traits_type::entity_type>(std::distance(first, last)));
 
             for(; first != last; ++first) {
                 if(const auto entt = *first; storage->contains(entt)) {
@@ -181,7 +181,7 @@ public:
     /*! Basic registry type. */
     using registry_type = Registry;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename registry_type::entity_type;
+    using entity_type = registry_type::entity_type;
 
     /**
      * @brief Constructs an instance that is bound to a given registry.
@@ -307,7 +307,7 @@ class basic_continuous_loader {
     static_assert(!std::is_const_v<Registry>, "Non-const registry type required");
     using traits_type = entt_traits<typename Registry::entity_type>;
 
-    void restore(typename Registry::entity_type entt) {
+    void restore(Registry::entity_type entt) {
         if(const auto entity = to_entity(entt); remloc.contains(entity) && remloc[entity].first == entt) {
             if(!reg->valid(remloc[entity].second)) {
                 remloc[entity].second = reg->create();
@@ -324,7 +324,7 @@ class basic_continuous_loader {
 
         for(auto &&pair: container) {
             using first_type = std::remove_const_t<typename std::decay_t<decltype(pair)>::first_type>;
-            using second_type = typename std::decay_t<decltype(pair)>::second_type;
+            using second_type = std::decay_t<decltype(pair)>::second_type;
 
             if constexpr(std::is_same_v<first_type, entity_type> && std::is_same_v<second_type, entity_type>) {
                 other.emplace(map(pair.first), map(pair.second));
@@ -366,7 +366,7 @@ public:
     /*! Basic registry type. */
     using registry_type = Registry;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename registry_type::entity_type;
+    using entity_type = registry_type::entity_type;
 
     /**
      * @brief Constructs an instance that is bound to a given registry.

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

@@ -22,10 +22,10 @@ namespace internal {
 
 template<typename Container>
 struct sparse_set_iterator final {
-    using value_type = typename Container::value_type;
-    using pointer = typename Container::const_pointer;
-    using reference = typename Container::const_reference;
-    using difference_type = typename Container::difference_type;
+    using value_type = Container::value_type;
+    using pointer = Container::const_pointer;
+    using reference = Container::const_reference;
+    using difference_type = Container::difference_type;
     using iterator_category = std::random_access_iterator_tag;
 
     constexpr sparse_set_iterator() noexcept
@@ -73,7 +73,7 @@ struct sparse_set_iterator final {
     }
 
     [[nodiscard]] constexpr reference operator[](const difference_type value) const noexcept {
-        return (*packed)[static_cast<typename Container::size_type>(index() - value)];
+        return (*packed)[static_cast<Container::size_type>(index() - value)];
     }
 
     [[nodiscard]] constexpr pointer operator->() const noexcept {
@@ -227,8 +227,8 @@ class basic_sparse_set {
         auto &from = packed[lhs];
         auto &to = packed[rhs];
 
-        sparse_ref(from) = traits_type::combine(static_cast<typename traits_type::entity_type>(rhs), traits_type::to_integral(from));
-        sparse_ref(to) = traits_type::combine(static_cast<typename traits_type::entity_type>(lhs), traits_type::to_integral(to));
+        sparse_ref(from) = traits_type::combine(static_cast<traits_type::entity_type>(rhs), traits_type::to_integral(from));
+        sparse_ref(to) = traits_type::combine(static_cast<traits_type::entity_type>(lhs), traits_type::to_integral(to));
 
         std::swap(from, to);
     }
@@ -282,7 +282,7 @@ protected:
     void in_place_pop(const basic_iterator it) {
         ENTT_ASSERT(mode == deletion_policy::in_place, "Deletion policy mismatch");
         const auto pos = entity_to_pos(std::exchange(sparse_ref(*it), null));
-        packed[pos] = traits_type::combine(static_cast<typename traits_type::entity_type>(std::exchange(head, pos)), tombstone);
+        packed[pos] = traits_type::combine(static_cast<traits_type::entity_type>(std::exchange(head, pos)), tombstone);
     }
 
     /**
@@ -351,7 +351,7 @@ protected:
             if(head != max_size && !force_back) {
                 pos = head;
                 ENTT_ASSERT(elem == null, "Slot not available");
-                elem = traits_type::combine(static_cast<typename traits_type::entity_type>(head), traits_type::to_integral(entt));
+                elem = traits_type::combine(static_cast<traits_type::entity_type>(head), traits_type::to_integral(entt));
                 head = entity_to_pos(std::exchange(packed[pos], entt));
                 break;
             }
@@ -359,12 +359,12 @@ protected:
         case deletion_policy::swap_and_pop:
             packed.push_back(entt);
             ENTT_ASSERT(elem == null, "Slot not available");
-            elem = traits_type::combine(static_cast<typename traits_type::entity_type>(packed.size() - 1u), traits_type::to_integral(entt));
+            elem = traits_type::combine(static_cast<traits_type::entity_type>(packed.size() - 1u), traits_type::to_integral(entt));
             break;
         case deletion_policy::swap_only:
             if(elem == null) {
                 packed.push_back(entt);
-                elem = traits_type::combine(static_cast<typename traits_type::entity_type>(packed.size() - 1u), traits_type::to_integral(entt));
+                elem = traits_type::combine(static_cast<traits_type::entity_type>(packed.size() - 1u), traits_type::to_integral(entt));
             } else {
                 ENTT_ASSERT(!(entity_to_pos(elem) < head), "Slot not available");
                 bump(entt);
@@ -386,15 +386,15 @@ public:
     /*! @brief Allocator type. */
     using allocator_type = Allocator;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename traits_type::value_type;
+    using entity_type = traits_type::value_type;
     /*! @brief Underlying version type. */
-    using version_type = typename traits_type::version_type;
+    using version_type = traits_type::version_type;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
     /*! @brief Signed integer type. */
     using difference_type = std::ptrdiff_t;
     /*! @brief Pointer type to contained entities. */
-    using pointer = typename packed_container_type::const_pointer;
+    using pointer = packed_container_type::const_pointer;
     /*! @brief Random access iterator type. */
     using iterator = basic_iterator;
     /*! @brief Constant random access iterator type. */
@@ -932,7 +932,7 @@ public:
                     swap_or_move(from, to);
 
                     packed[to] = packed[from];
-                    const auto elem = static_cast<typename traits_type::entity_type>(to);
+                    const auto elem = static_cast<traits_type::entity_type>(to);
                     sparse_ref(packed[to]) = traits_type::combine(elem, traits_type::to_integral(packed[to]));
 
                     for(; from && packed[from - 1u] == tombstone; --from) {}
@@ -1011,7 +1011,7 @@ public:
                 const auto entt = packed[curr];
 
                 swap_or_move(next, idx);
-                const auto elem = static_cast<typename traits_type::entity_type>(curr);
+                const auto elem = static_cast<traits_type::entity_type>(curr);
                 sparse_ref(entt) = traits_type::combine(elem, traits_type::to_integral(packed[curr]));
                 curr = std::exchange(next, idx);
             }

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

@@ -36,10 +36,10 @@ class storage_iterator final {
         typename alloc_traits::template rebind_traits<typename std::pointer_traits<typename container_type::value_type>::element_type>::pointer>>;
 
 public:
-    using value_type = typename iterator_traits::value_type;
-    using pointer = typename iterator_traits::pointer;
-    using reference = typename iterator_traits::reference;
-    using difference_type = typename iterator_traits::difference_type;
+    using value_type = iterator_traits::value_type;
+    using pointer = iterator_traits::pointer;
+    using reference = iterator_traits::reference;
+    using difference_type = iterator_traits::difference_type;
     using iterator_category = std::random_access_iterator_tag;
 
     constexpr storage_iterator() noexcept = default;
@@ -89,7 +89,7 @@ public:
     }
 
     [[nodiscard]] constexpr reference operator[](const difference_type value) const noexcept {
-        const auto pos = static_cast<typename Container::size_type>(index() - value);
+        const auto pos = static_cast<Container::size_type>(index() - value);
         return (*payload)[pos / Page][fast_mod(static_cast<std::size_t>(pos), Page)];
     }
 
@@ -231,7 +231,7 @@ class basic_storage: public basic_sparse_set<Entity, typename std::allocator_tra
     static_assert(std::is_same_v<typename alloc_traits::value_type, Type>, "Invalid value type");
     using container_type = std::vector<typename alloc_traits::pointer, typename alloc_traits::template rebind_alloc<typename alloc_traits::pointer>>;
     using underlying_type = basic_sparse_set<Entity, typename alloc_traits::template rebind_alloc<Entity>>;
-    using underlying_iterator = typename underlying_type::basic_iterator;
+    using underlying_iterator = underlying_type::basic_iterator;
     using traits_type = component_traits<Type, Entity>;
 
     [[nodiscard]] auto &element_at(const std::size_t pos) const {
@@ -409,9 +409,9 @@ public:
     /*! @brief Signed integer type. */
     using difference_type = std::ptrdiff_t;
     /*! @brief Pointer type to contained elements. */
-    using pointer = typename container_type::pointer;
+    using pointer = container_type::pointer;
     /*! @brief Constant pointer type to contained elements. */
-    using const_pointer = typename alloc_traits::template rebind_traits<typename alloc_traits::const_pointer>::const_pointer;
+    using const_pointer = alloc_traits::template rebind_traits<typename alloc_traits::const_pointer>::const_pointer;
     /*! @brief Random access iterator type. */
     using iterator = internal::storage_iterator<container_type, traits_type::page_size>;
     /*! @brief Constant random access iterator type. */
@@ -974,11 +974,11 @@ class basic_storage<Entity, Entity, Allocator>
     : public basic_sparse_set<Entity, Allocator> {
     using alloc_traits = std::allocator_traits<Allocator>;
     static_assert(std::is_same_v<typename alloc_traits::value_type, Entity>, "Invalid value type");
-    using underlying_iterator = typename basic_sparse_set<Entity, Allocator>::basic_iterator;
+    using underlying_iterator = basic_sparse_set<Entity, Allocator>::basic_iterator;
     using traits_type = entt_traits<Entity>;
 
     auto from_placeholder() noexcept {
-        const auto entt = traits_type::combine(static_cast<typename traits_type::entity_type>(placeholder), {});
+        const auto entt = traits_type::combine(static_cast<traits_type::entity_type>(placeholder), {});
         ENTT_ASSERT(entt != null, "No more entities available");
         placeholder += static_cast<size_type>(entt != null);
         return entt;

+ 21 - 21
src/entt/entity/view.hpp

@@ -63,10 +63,10 @@ class view_iterator final {
     template<typename, typename...>
     friend class extended_view_iterator;
 
-    using iterator_type = typename Type::const_iterator;
+    using iterator_type = Type::const_iterator;
     using iterator_traits = std::iterator_traits<iterator_type>;
 
-    [[nodiscard]] bool valid(const typename iterator_traits::value_type entt) const noexcept {
+    [[nodiscard]] bool valid(const iterator_traits::value_type entt) const noexcept {
         return (!Checked || (entt != tombstone))
                && ((Get == 1u) || (internal::all_of(pools.begin(), pools.begin() + index, entt) && internal::all_of(pools.begin() + index + 1, pools.end(), entt)))
                && ((Exclude == 0u) || internal::none_of(filter.begin(), filter.end(), entt));
@@ -77,10 +77,10 @@ class view_iterator final {
     }
 
 public:
-    using value_type = typename iterator_traits::value_type;
-    using pointer = typename iterator_traits::pointer;
-    using reference = typename iterator_traits::reference;
-    using difference_type = typename iterator_traits::difference_type;
+    using value_type = iterator_traits::value_type;
+    using pointer = iterator_traits::pointer;
+    using reference = iterator_traits::reference;
+    using difference_type = iterator_traits::difference_type;
     using iterator_category = std::forward_iterator_tag;
 
     constexpr view_iterator() noexcept
@@ -287,7 +287,7 @@ protected:
         filter[pos] = elem;
     }
 
-    [[nodiscard]] bool none_of(const typename Type::entity_type entt) const noexcept {
+    [[nodiscard]] bool none_of(const Type::entity_type entt) const noexcept {
         return internal::none_of(filter.begin(), filter.end(), entt);
     }
 
@@ -300,7 +300,7 @@ public:
     /*! @brief Common type among all storage types. */
     using common_type = Type;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename Type::entity_type;
+    using entity_type = Type::entity_type;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
     /*! @brief Signed integer type. */
@@ -440,7 +440,7 @@ class basic_view<get_t<Get...>, exclude_t<Exclude...>, std::enable_if_t<(sizeof.
     static constexpr std::size_t index_of = type_list_index_v<std::remove_const_t<Type>, type_list<typename Get::element_type..., typename Exclude::element_type...>>;
 
     template<std::size_t... Index>
-    [[nodiscard]] auto get(const typename base_type::entity_type entt, std::index_sequence<Index...>) const noexcept {
+    [[nodiscard]] auto get(const base_type::entity_type entt, std::index_sequence<Index...>) const noexcept {
         return std::tuple_cat(storage<Index>()->get_as_tuple(entt)...);
     }
 
@@ -475,15 +475,15 @@ class basic_view<get_t<Get...>, exclude_t<Exclude...>, std::enable_if_t<(sizeof.
 
 public:
     /*! @brief Common type among all storage types. */
-    using common_type = typename base_type::common_type;
+    using common_type = base_type::common_type;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename base_type::entity_type;
+    using entity_type = base_type::entity_type;
     /*! @brief Unsigned integer type. */
-    using size_type = typename base_type::size_type;
+    using size_type = base_type::size_type;
     /*! @brief Signed integer type. */
     using difference_type = std::ptrdiff_t;
     /*! @brief Forward iterator type. */
-    using iterator = typename base_type::iterator;
+    using iterator = base_type::iterator;
     /*! @brief Iterable view type. */
     using iterable = iterable_adaptor<internal::extended_view_iterator<iterator, Get...>>;
 
@@ -697,7 +697,7 @@ public:
     /*! @brief Common type among all storage types. */
     using common_type = Type;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename common_type::entity_type;
+    using entity_type = common_type::entity_type;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
     /*! @brief Signed integer type. */
@@ -915,17 +915,17 @@ class basic_view<get_t<Get>, exclude_t<>>
 
 public:
     /*! @brief Common type among all storage types. */
-    using common_type = typename base_type::common_type;
+    using common_type = base_type::common_type;
     /*! @brief Underlying entity identifier. */
-    using entity_type = typename base_type::entity_type;
+    using entity_type = base_type::entity_type;
     /*! @brief Unsigned integer type. */
-    using size_type = typename base_type::size_type;
+    using size_type = base_type::size_type;
     /*! @brief Signed integer type. */
     using difference_type = std::ptrdiff_t;
     /*! @brief Random access iterator type. */
-    using iterator = typename base_type::iterator;
+    using iterator = base_type::iterator;
     /*! @brief Reverse iterator type. */
-    using reverse_iterator = typename base_type::reverse_iterator;
+    using reverse_iterator = base_type::reverse_iterator;
     /*! @brief Iterable view type. */
     using iterable = std::conditional_t<Get::storage_policy == deletion_policy::in_place, iterable_adaptor<internal::extended_view_iterator<iterator, Get>>, decltype(std::declval<Get>().each())>;
 
@@ -953,7 +953,7 @@ public:
      * @tparam Type Type of element of which to return the storage.
      * @return The storage for the given element type.
      */
-    template<typename Type = typename Get::element_type>
+    template<typename Type = Get::element_type>
     [[nodiscard]] auto *storage() const noexcept {
         static_assert(std::is_same_v<std::remove_const_t<Type>, typename Get::element_type>, "Invalid element type");
         return storage<0>();
@@ -1042,7 +1042,7 @@ public:
      *
      * @code{.cpp}
      * void(const entity_type, Type &);
-     * void(typename Type &);
+     * void(Type &);
      * @endcode
      *
      * @tparam Func Type of the function object to invoke.