Przeglądaj źródła

view/runtime_view: make iterator_type private

Michele Caini 4 lat temu
rodzic
commit
03fea6358b
2 zmienionych plików z 4 dodań i 2 usunięć
  1. 2 1
      src/entt/entity/runtime_view.hpp
  2. 2 1
      src/entt/entity/view.hpp

+ 2 - 1
src/entt/entity/runtime_view.hpp

@@ -22,6 +22,8 @@ namespace internal {
 
 template<typename Type>
 class runtime_view_iterator final {
+    using iterator_type = typename Type::iterator;
+
     [[nodiscard]] bool valid() const {
         return (!tombstone_check || *it != tombstone)
                && std::all_of(++pools->begin(), pools->end(), [entt = *it](const auto *curr) { return curr->contains(entt); })
@@ -29,7 +31,6 @@ class runtime_view_iterator final {
     }
 
 public:
-    using iterator_type = typename Type::iterator;
     using difference_type = typename iterator_type::difference_type;
     using value_type = typename iterator_type::value_type;
     using pointer = typename iterator_type::pointer;

+ 2 - 1
src/entt/entity/view.hpp

@@ -28,6 +28,8 @@ namespace internal {
 
 template<typename Type, std::size_t Component, std::size_t Exclude>
 class view_iterator final {
+    using iterator_type = typename Type::iterator;
+
     [[nodiscard]] bool valid() const ENTT_NOEXCEPT {
         return ((Component != 0u) || (*it != tombstone))
                && std::apply([entt = *it](const auto *...curr) { return (curr->contains(entt) && ...); }, pools)
@@ -35,7 +37,6 @@ class view_iterator final {
     }
 
 public:
-    using iterator_type = typename Type::iterator;
     using difference_type = typename std::iterator_traits<iterator_type>::difference_type;
     using value_type = typename std::iterator_traits<iterator_type>::value_type;
     using pointer = typename std::iterator_traits<iterator_type>::pointer;