From 2975d14352ce2a21ddcd3a2a8e07eab9329db048 Mon Sep 17 00:00:00 2001 From: skypjack Date: Mon, 20 Apr 2026 15:45:24 +0200 Subject: [PATCH] stl: std::all_of --- src/entt/entity/registry.hpp | 6 +++--- src/entt/entity/runtime_view.hpp | 4 ++-- src/entt/stl/algorithm.hpp | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 27f26b781..9ade62a23 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -580,7 +580,7 @@ public: */ template void insert(stl::input_iterator auto first, stl::input_iterator auto last, const Type &value = {}) { - ENTT_ASSERT(std::all_of(first, last, [this](const auto entt) { return valid(entt); }), "Invalid entity"); + ENTT_ASSERT(stl::all_of(first, last, [this](const auto entt) { return valid(entt); }), "Invalid entity"); assure().insert(stl::move(first), stl::move(last), value); } @@ -599,7 +599,7 @@ public: template requires stl::same_as::value_type, Type> void insert(EIt first, EIt last, CIt from) { - ENTT_ASSERT(std::all_of(first, last, [this](const auto entt) { return valid(entt); }), "Invalid entity"); + ENTT_ASSERT(stl::all_of(first, last, [this](const auto entt) { return valid(entt); }), "Invalid entity"); assure().insert(first, last, from); } @@ -1058,7 +1058,7 @@ public: handler = std::allocate_shared(get_allocator(), get_allocator(), stl::forward_as_tuple(assure>()...), stl::forward_as_tuple(assure>()...)); } else { handler = std::allocate_shared(get_allocator(), stl::forward_as_tuple(assure>()..., assure>()...), stl::forward_as_tuple(assure>()...)); - ENTT_ASSERT(std::all_of(groups.cbegin(), groups.cend(), [](const auto &data) { return !(data.second->owned(type_id().hash()) || ...); }), "Conflicting groups"); + ENTT_ASSERT(stl::all_of(groups.cbegin(), groups.cend(), [](const auto &data) { return !(data.second->owned(type_id().hash()) || ...); }), "Conflicting groups"); } groups.emplace(group_type::group_id(), handler); diff --git a/src/entt/entity/runtime_view.hpp b/src/entt/entity/runtime_view.hpp index e2b007cff..47cd1b1fb 100644 --- a/src/entt/entity/runtime_view.hpp +++ b/src/entt/entity/runtime_view.hpp @@ -21,7 +21,7 @@ class runtime_view_iterator final { [[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); }) + && stl::all_of(++pools->begin(), pools->end(), [entt = *it](const auto *curr) { return curr->contains(entt); }) && stl::none_of(filter->cbegin(), filter->cend(), [entt = *it](const auto *curr) { return curr && curr->contains(entt); }); } @@ -286,7 +286,7 @@ public: */ [[nodiscard]] bool contains(const entity_type entt) const { return !pools.empty() - && std::all_of(pools.cbegin(), pools.cend(), [entt](const auto *curr) { return curr->contains(entt); }) + && stl::all_of(pools.cbegin(), pools.cend(), [entt](const auto *curr) { return curr->contains(entt); }) && stl::none_of(filter.cbegin(), filter.cend(), [entt](const auto *curr) { return curr && curr->contains(entt); }) && pools.front()->index(entt) < offset(); } diff --git a/src/entt/stl/algorithm.hpp b/src/entt/stl/algorithm.hpp index 9d9a290a3..c23b3689c 100644 --- a/src/entt/stl/algorithm.hpp +++ b/src/entt/stl/algorithm.hpp @@ -6,6 +6,7 @@ /*! @cond ENTT_INTERNAL */ namespace entt::stl { +using std::all_of; using std::none_of; using std::sort;