Browse Source

view: refine ::find and internal asserts

Michele Caini 1 year ago
parent
commit
ae582973d0
2 changed files with 4 additions and 7 deletions
  1. 2 1
      TODO
  2. 2 6
      src/entt/entity/view.hpp

+ 2 - 1
TODO

@@ -34,7 +34,8 @@ TODO:
 * review cmake warning about FetchContent_Populate (need .28 and EXCLUDE_FROM_ALL for FetchContent)
 * after removing meta prop vectors, copy meta objects in their handles directly
 * suppress -Wself-move on CI with g++13
-* view and view iterator specializations for multi, single and filtered elements
+* view specializations for multi, single and filtered elements
+* view iterator specialization for single non-in-place storage (exclude only, no tombstone check required)
 * organizer support to groups
 * meta range: move id to meta objects and return plain types (?), then remove id from meta base and meta ctor too
 * refine the storage fallback mechanism for views (ie alloc?)

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

@@ -95,10 +95,7 @@ public:
           pools{value},
           filter{excl},
           index{idx} {
-        if constexpr(storage_view_iterator) {
-            ENTT_ASSERT((pools[0u] == nullptr) || pools[0u]->policy() == deletion_policy::in_place, "Non in-place storage view iterator");
-        }
-
+        ENTT_ASSERT(!storage_view_iterator || pools[0u]->policy() == deletion_policy::in_place, "Non in-place storage view iterator");
         seek_next();
     }
 
@@ -852,8 +849,7 @@ public:
             const auto it = leading ? leading->find(entt) : iterator{};
             return leading && (static_cast<size_type>(it.index()) < leading->free_list()) ? it : iterator{};
         } else {
-            const auto it = leading ? leading->find(entt) : typename common_type::iterator{};
-            return iterator{it, {leading}, {}, 0u};
+            return leading ? iterator{leading->find(entt), {leading}, {}, 0u} : iterator{};
         }
     }