view: drop <algorithm> (no longer required)

This commit is contained in:
Michele Caini
2022-07-01 15:22:01 +02:00
parent c5afd8f589
commit 50e67d7c15

View File

@@ -1,7 +1,6 @@
#ifndef ENTT_ENTITY_VIEW_HPP
#define ENTT_ENTITY_VIEW_HPP
#include <algorithm>
#include <array>
#include <iterator>
#include <tuple>
@@ -262,7 +261,7 @@ public:
basic_view(Get &...get, Exclude &...exclude) noexcept
: pools{&get...},
filter{&exclude...},
view{(std::min)({&static_cast<const base_type &>(get)...}, [](auto *lhs, auto *rhs) { return lhs->size() < rhs->size(); })} {}
view{[](const base_type *first, const auto *...other) { ((first = other->size() < first->size() ? other : first), ...); return first; }(&get...)} {}
/**
* @brief Constructs a multi-type view from a set of storage classes.
@@ -272,7 +271,7 @@ public:
basic_view(std::tuple<Get &...> get, std::tuple<Exclude &...> exclude = {}) noexcept
: pools{std::apply([](auto &...curr) { return std::make_tuple(&curr...); }, get)},
filter{std::apply([](auto &...curr) { return std::make_tuple(&curr...); }, exclude)},
view{std::apply([](const auto &...curr) { return (std::min)({&static_cast<const base_type &>(curr)...}, [](auto *lhs, auto *rhs) { return lhs->size() < rhs->size(); }); }, get)} {}
view{std::apply([](const base_type *first, const auto *...other) { ((first = other->size() < first->size() ? other : first), ...); return first; }, pools)} {}
/**
* @brief Creates a new view driven by a given component in its iterations.