diff --git a/include/oneapi/dpl/pstl/zip_view_impl.h b/include/oneapi/dpl/pstl/zip_view_impl.h index f975e9a255..6b3afad9e0 100644 --- a/include/oneapi/dpl/pstl/zip_view_impl.h +++ b/include/oneapi/dpl/pstl/zip_view_impl.h @@ -309,20 +309,21 @@ class zip_view : public std::ranges::view_interface> { constexpr auto end() requires (std::ranges::range && ...) // requires !simple_view { { - if constexpr (!zip_is_common) { - return std::apply([](auto... views) { - return sentinel(std::ranges::end(views)...); - }, - views_); - } else if constexpr ((std::ranges::random_access_range && ...)) { + if constexpr (!zip_is_common) + { + auto __tr = [](auto... __args) { return sentinel(__args...);}; + return apply_to_tuple(__tr, std::ranges::end, views_); + } + else if constexpr ((std::ranges::random_access_range && ...)) + { auto it = begin(); it += size(); return it; - } else { - return std::apply([](auto... views) { - return iterator(std::ranges::end(views)...); - }, - views_); + } + else + { + auto __tr = [](auto... __args) { return iterator(__args...);}; + return apply_to_tuple(__tr, std::ranges::end, views_); } }