view: make a check that is going to disappear private

This commit is contained in:
Michele Caini
2024-06-27 16:50:26 +02:00
parent 1bf23c5989
commit c78c0c2bf1

View File

@@ -393,8 +393,6 @@ class basic_view<get_t<Get...>, exclude_t<Exclude...>>: public basic_common_view
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...>>;
static constexpr bool tombstone_check_required = ((sizeof...(Get) == 1u) && ... && (Get::storage_policy == deletion_policy::in_place));
template<std::size_t... Index>
[[nodiscard]] auto get(const typename base_type::entity_type entt, std::index_sequence<Index...>) const noexcept {
return std::tuple_cat(storage<Index>()->get_as_tuple(entt)...);
@@ -411,6 +409,8 @@ class basic_view<get_t<Get...>, exclude_t<Exclude...>>: public basic_common_view
template<std::size_t Curr, typename Func, std::size_t... Index>
void each(Func &func, std::index_sequence<Index...>) const {
static constexpr bool tombstone_check_required = ((sizeof...(Get) == 1u) && ... && (Get::storage_policy == deletion_policy::in_place));
for(const auto curr: storage<Curr>()->each()) {
if(const auto entt = std::get<0>(curr); (!tombstone_check_required || (entt != tombstone)) && ((Curr == Index || this->pools[Index]->contains(entt)) && ...) && internal::none_of(this->filter.begin(), this->filter.end(), entt)) {
if constexpr(is_applicable_v<Func, decltype(std::tuple_cat(std::tuple<entity_type>{}, std::declval<basic_view>().get({})))>) {