Explorar o código

view: drop <algorithm> (no longer required)

Michele Caini %!s(int64=3) %!d(string=hai) anos
pai
achega
50e67d7c15
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      src/entt/entity/view.hpp

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

@@ -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.