Browse Source

container: cleanup

skypjack 3 tháng trước cách đây
mục cha
commit
f1e59c4ea4
2 tập tin đã thay đổi với 10 bổ sung10 xóa
  1. 4 4
      src/entt/container/dense_map.hpp
  2. 6 6
      src/entt/container/dense_set.hpp

+ 4 - 4
src/entt/container/dense_map.hpp

@@ -205,7 +205,7 @@ public:
           offset{other.offset} {}
 
     constexpr dense_map_local_iterator &operator++() noexcept {
-        return (offset = it[static_cast<typename It::difference_type>(offset)].next), *this;
+        return (offset = it[static_cast<It::difference_type>(offset)].next), *this;
     }
 
     constexpr dense_map_local_iterator operator++(int) noexcept {
@@ -218,7 +218,7 @@ public:
     }
 
     [[nodiscard]] constexpr reference operator*() const noexcept {
-        const auto idx = static_cast<typename It::difference_type>(offset);
+        const auto idx = static_cast<It::difference_type>(offset);
         return {it[idx].element.first, it[idx].element.second};
     }
 
@@ -279,7 +279,7 @@ class dense_map {
     [[nodiscard]] auto constrained_find(const Other &key, const std::size_t bucket) {
         for(auto offset = sparse.first()[bucket]; offset != placeholder_position; offset = packed.first()[offset].next) {
             if(packed.second()(packed.first()[offset].element.first, key)) {
-                return begin() + static_cast<typename iterator::difference_type>(offset);
+                return begin() + static_cast<iterator::difference_type>(offset);
             }
         }
 
@@ -290,7 +290,7 @@ class dense_map {
     [[nodiscard]] auto constrained_find(const Other &key, const std::size_t bucket) const {
         for(auto offset = sparse.first()[bucket]; offset != placeholder_position; offset = packed.first()[offset].next) {
             if(packed.second()(packed.first()[offset].element.first, key)) {
-                return cbegin() + static_cast<typename const_iterator::difference_type>(offset);
+                return cbegin() + static_cast<const_iterator::difference_type>(offset);
             }
         }
 

+ 6 - 6
src/entt/container/dense_set.hpp

@@ -31,7 +31,7 @@ class dense_set_iterator final {
     friend class dense_set_iterator;
 
 public:
-    using value_type = typename It::value_type::second_type;
+    using value_type = It::value_type::second_type;
     using pointer = const value_type *;
     using reference = const value_type &;
     using difference_type = std::ptrdiff_t;
@@ -149,7 +149,7 @@ class dense_set_local_iterator final {
     friend class dense_set_local_iterator;
 
 public:
-    using value_type = typename It::value_type::second_type;
+    using value_type = It::value_type::second_type;
     using pointer = const value_type *;
     using reference = const value_type &;
     using difference_type = std::ptrdiff_t;
@@ -167,7 +167,7 @@ public:
           offset{other.offset} {}
 
     constexpr dense_set_local_iterator &operator++() noexcept {
-        return offset = it[static_cast<typename It::difference_type>(offset)].first, *this;
+        return offset = it[static_cast<It::difference_type>(offset)].first, *this;
     }
 
     constexpr dense_set_local_iterator operator++(int) noexcept {
@@ -176,7 +176,7 @@ public:
     }
 
     [[nodiscard]] constexpr pointer operator->() const noexcept {
-        return std::addressof(it[static_cast<typename It::difference_type>(offset)].second);
+        return std::addressof(it[static_cast<It::difference_type>(offset)].second);
     }
 
     [[nodiscard]] constexpr reference operator*() const noexcept {
@@ -238,7 +238,7 @@ class dense_set {
     [[nodiscard]] auto constrained_find(const Other &value, const std::size_t bucket) {
         for(auto offset = sparse.first()[bucket]; offset != placeholder_position; offset = packed.first()[offset].first) {
             if(packed.second()(packed.first()[offset].second, value)) {
-                return begin() + static_cast<typename iterator::difference_type>(offset);
+                return begin() + static_cast<iterator::difference_type>(offset);
             }
         }
 
@@ -249,7 +249,7 @@ class dense_set {
     [[nodiscard]] auto constrained_find(const Other &value, const std::size_t bucket) const {
         for(auto offset = sparse.first()[bucket]; offset != placeholder_position; offset = packed.first()[offset].first) {
             if(packed.second()(packed.first()[offset].second, value)) {
-                return cbegin() + static_cast<typename const_iterator::difference_type>(offset);
+                return cbegin() + static_cast<const_iterator::difference_type>(offset);
             }
         }