1
0
Эх сурвалжийг харах

view: make also VS toolset v141 happy

Michele Caini 3 жил өмнө
parent
commit
c2ab357802

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

@@ -23,13 +23,6 @@ namespace entt {
 
 namespace internal {
 
-template<typename Type, typename... Other>
-std::enable_if_t<(std::is_same_v<Type, Other> && ...), const Type *>
-pick_best(const Type *first, const Other *...other) noexcept {
-    ((first = other->size() < first->size() ? other : first), ...);
-    return first;
-}
-
 template<typename... Args, typename Type, std::size_t N>
 auto filter_as_tuple(const std::array<const Type *, N> &filter) noexcept {
     return std::apply([](const auto *...curr) { return std::make_tuple(static_cast<Args *>(const_cast<constness_as_t<Type, Args> *>(curr))...); }, filter);
@@ -271,7 +264,9 @@ public:
     basic_view(Get &...value, Exclude &...exclude) noexcept
         : pools{&value...},
           filter{&exclude...},
-          view{internal::pick_best(static_cast<const base_type *>(&value)...)} {}
+          view{std::get<0>(pools)} {
+        ((view = value.size() < view->size() ? &value : view), ...);
+    }
 
     /**
      * @brief Constructs a multi-type view from a set of storage classes.