Skip to content

Commit

Permalink
[oneDPL][ranges][zip_view] + apply_to_tuple instead of std::apply; st…
Browse files Browse the repository at this point in the history
…d::apply doesnt work with oneDPL tuple
  • Loading branch information
MikeDvorskiy committed Sep 25, 2024
1 parent 3e97934 commit 9342293
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions include/oneapi/dpl/pstl/zip_view_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,20 +309,21 @@ class zip_view : public std::ranges::view_interface<zip_view<Views...>> {

constexpr auto end() requires (std::ranges::range<Views> && ...) // requires !simple_view {
{
if constexpr (!zip_is_common<Views...>) {
return std::apply([](auto... views) {
return sentinel<false>(std::ranges::end(views)...);
},
views_);
} else if constexpr ((std::ranges::random_access_range<Views> && ...)) {
if constexpr (!zip_is_common<Views...>)
{
auto __tr = [](auto... __args) { return sentinel<false>(__args...);};
return apply_to_tuple(__tr, std::ranges::end, views_);
}
else if constexpr ((std::ranges::random_access_range<Views> && ...))
{
auto it = begin();
it += size();
return it;
} else {
return std::apply([](auto... views) {
return iterator<false>(std::ranges::end(views)...);
},
views_);
}
else
{
auto __tr = [](auto... __args) { return iterator<false>(__args...);};
return apply_to_tuple(__tr, std::ranges::end, views_);
}
}

Expand Down

0 comments on commit 9342293

Please sign in to comment.