Skip to content

[oneDPL] Add more in-place mutating parallel range aglrithms #634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ In-place Mutating Operations
std::indirectly_writable<std::ranges::iterator_t<R>, const T&>
std::ranges::borrowed_iterator_t<R>
fill (ExecutionPolicy&& pol, R&& r, const T& value);

// replace
template <typename ExecutionPolicy, std::ranges::random_access_range R,
typename Proj = std::identity,
Expand Down Expand Up @@ -524,6 +524,33 @@ In-place Mutating Operations
std::ranges::borrowed_subrange_t<R>
remove_if (ExecutionPolicy&& pol, R&& r, Pred pred, Proj proj = {});

// reverse
template <typename ExecutionPolicy, std::ranges::random_access_range R>
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
std::ranges::sized_range<R> && std::permutable<std::ranges::iterator_t<R>>
std::ranges::borrowed_iterator_t<R>
reverse (ExecutionPolicy&& pol, R&& r);

// swap_ranges
template <typename ExecutionPolicy, std::ranges::random_access_range R1,
std::ranges::random_access_range R2>
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
std::ranges::sized_range<R1> && std::ranges::sized_range<R2> &&
std::indirectly_swappable<std::ranges::iterator_t<R1>, std::ranges::iterator_t<R2>>
std::ranges::swap_ranges_result<std::ranges::borrowed_iterator_t<R1>,
std::ranges::borrowed_iterator_t<R2>>
swap_ranges (ExecutionPolicy&& pol, R1&& r1, R2&& r2);

// unique
template <typename ExecutionPolicy, std::ranges::random_access_range R,
typename Proj = std::identity,
std::indirect_equivalence_relation< std::projected<std::ranges::iterator_t<R>, Proj> >
Comp = std::ranges::equal_to>
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
std::ranges::sized_range<R> && std::permutable<std::ranges::iterator_t<R>>
std::ranges::borrowed_subrange_t<R>
unique (ExecutionPolicy&& pol, R&& r, Comp comp = {}, Proj proj = {});

}

.. _`C++ Standard`: https://isocpp.org/std/the-standard
Expand Down
Loading