Skip to content

Commit c2ab357

Browse files
committed
view: make also VS toolset v141 happy
1 parent 4fb558f commit c2ab357

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/entt/entity/view.hpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ namespace entt {
2323

2424
namespace internal {
2525

26-
template<typename Type, typename... Other>
27-
std::enable_if_t<(std::is_same_v<Type, Other> && ...), const Type *>
28-
pick_best(const Type *first, const Other *...other) noexcept {
29-
((first = other->size() < first->size() ? other : first), ...);
30-
return first;
31-
}
32-
3326
template<typename... Args, typename Type, std::size_t N>
3427
auto filter_as_tuple(const std::array<const Type *, N> &filter) noexcept {
3528
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 @@ class basic_view<get_t<Get...>, exclude_t<Exclude...>> {
271264
basic_view(Get &...value, Exclude &...exclude) noexcept
272265
: pools{&value...},
273266
filter{&exclude...},
274-
view{internal::pick_best(static_cast<const base_type *>(&value)...)} {}
267+
view{std::get<0>(pools)} {
268+
((view = value.size() < view->size() ? &value : view), ...);
269+
}
275270

276271
/**
277272
* @brief Constructs a multi-type view from a set of storage classes.

0 commit comments

Comments
 (0)