![]() |
hpx::parallel::v1::swap_ranges
// In header: <hpx/parallel/detail/swap_ranges.hpp> template<typename ExPolicy, typename ForwardIter1, typename ForwardIter2> unspecified swap_ranges(ExPolicy && policy, ForwardIter1 first1, ForwardIter1 last1, ForwardIter2 first2);
Exchanges elements between range [first1, last1) and another range starting at first2.
![]() |
Note |
---|---|
Complexity: Linear in the distance between first1 and last1 |
The swap operations in the parallel swap_ranges algorithm invoked with an execution policy object of type sequential_execution_policy
execute in sequential order in the calling thread.
The swap operations in the parallel swap_ranges algorithm invoked with an execution policy object of type parallel_execution_policy
or task_execution_policy
are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
Parameters: |
|
||||||||
Template Parameters: |
|
||||||||
Returns: |
The swap_ranges algorithm returns a hpx::future<ForwardIter2> if the execution policy is of type task_execution_policy and returns ForwardIter2 otherwise. The swap_ranges algorithm returns iterator to the element past the last element exchanged in the range beginning with first2. |