view: drop unnecessary member

This commit is contained in:
Michele Caini
2024-06-14 15:16:50 +02:00
parent 12ae4cd4c1
commit d67fd1e72c
2 changed files with 7 additions and 8 deletions
-1
View File
@@ -34,6 +34,5 @@ TODO:
* more test around views and storage entity - ie view ::back
* table: pop back to support swap and pop, single column access, empty type optimization
* checkout tools workflow
* meta: avoid unnecessary copies of iterators with meta containers
* review constrained noexcept-ness (ie sigh)
* offer 16b from meta_traits to users or change type
+7 -7
View File
@@ -60,6 +60,10 @@ class view_iterator final {
&& internal::none_of(pools.begin() + Get, pools.end(), entt);
}
void seek_next() {
for(constexpr iterator_type sentinel{}; it != sentinel && !valid(*it); ++it) {}
}
public:
using value_type = typename iterator_traits::value_type;
using pointer = typename iterator_traits::pointer;
@@ -69,22 +73,19 @@ public:
constexpr view_iterator() noexcept
: it{},
last{},
pools{},
index{} {}
view_iterator(iterator_type first, std::array<const Type *, Size> value, const std::size_t idx) noexcept
: it{first},
last{value[idx]->end()},
pools{value},
index{idx} {
while(it != last && !valid(*it)) {
++it;
}
seek_next();
}
view_iterator &operator++() noexcept {
while(++it != last && !valid(*it)) {}
++it;
seek_next();
return *this;
}
@@ -106,7 +107,6 @@ public:
private:
iterator_type it;
iterator_type last;
std::array<const Type *, Size> pools;
std::size_t index;
};