hpx::ranges::remove_copy#
Defined in header hpx/algorithm.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
See also:
-
template<typename I, typename Sent, typename O, typename Proj = hpx::identity, typename T = typename hpx::parallel::traits::projected<I, Proj>::value_type>
remove_copy_result<I, O> hpx::ranges::remove_copy(I first, Sent last, O dest, T const &value, Proj &&proj = Proj())# Copies the elements in the range, defined by [first, last), to another range beginning at dest. Copies only the elements for which the comparison operator returns false when compare to val. The order of the elements that are not removed is preserved.
Effects: Copies all the elements referred to by the iterator it in the range [first,last) for which the following corresponding conditions do not hold: INVOKE(proj, *it) == value
The assignments in the parallel remove_copy algorithm execute in sequential order in the calling thread.
Note
Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate f.
- Template Parameters:
I – The type of the source iterators used (deduced). This iterator type must meet the requirements of an input iterator.
Sent – The type of the end iterators used (deduced). This sentinel type must be a sentinel for I.
O – The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.
T – The type that the result of dereferencing InIter is compared to.
Proj – The type of an optional projection function. This defaults to hpx::identity
- Parameters:
first – Refers to the beginning of the sequence of elements the algorithm will be applied to.
last – Refers to the end of the sequence of elements the algorithm will be applied to.
dest – Refers to the beginning of the destination range.
value – Value to be removed.
proj – Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
- Returns:
The ranges::remove_copy algorithm returns a ranges::remove_copy_result<I, O> The ranges::remove_copy algorithm returns an object {last, result + N}, where N is the number of elements copied.
-
template<typename Rng, typename O, typename Proj = hpx::identity, typename T = typename hpx::parallel::traits::projected<std::ranges::iterator_t<Rng>, Proj>::value_type>
remove_copy_result<std::ranges::iterator_t<Rng>, O> hpx::ranges::remove_copy(Rng &&rng, O dest, T const &val, Proj &&proj = Proj())# Copies the elements in the range, defined by rng, to another range beginning at dest. Copies only the elements for which the comparison operator returns false when compare to val. The order of the elements that are not removed is preserved.
Effects: Copies all the elements referred to by the iterator it in the range [first,last) for which the following corresponding conditions do not hold: INVOKE(proj, *it) == value
The assignments in the parallel remove_copy algorithm execute in sequential order in the calling thread.
Note
Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate f.
- Template Parameters:
Rng – The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.
O – The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.
T – The type that the result of dereferencing InIter is compared to.
Proj – The type of an optional projection function. This defaults to hpx::identity
- Parameters:
rng – Refers to the sequence of elements the algorithm will be applied to.
dest – Refers to the beginning of the destination range.
val – Value to be removed.
proj – Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
- Returns:
The ranges::remove_copy algorithm returns a remove_copy_result< std::ranges::iterator_t<Rng>, O>. The ranges::remove_copy algorithm returns an object {last, result + N}, where N is the number of elements copied.
-
template<typename ExPolicy, typename I, typename Sent, typename O, typename Proj = hpx::identity, typename T = typename hpx::parallel::traits::projected<I, Proj>::value_type>
parallel::util::detail::algorithm_result<ExPolicy, remove_copy_result<I, O>>::type hpx::ranges::remove_copy(ExPolicy &&policy, I first, Sent last, O dest, T const &value, Proj &&proj = Proj())# Copies the elements in the range, defined by [first, last), to another range beginning at dest. Copies only the elements for which the comparison operator returns false when compare to val. The order of the elements that are not removed is preserved.
Effects: Copies all the elements referred to by the iterator it in the range [first,last) for which the following corresponding conditions do not hold: INVOKE(proj, *it) == value
The assignments in the parallel remove_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The assignments in the parallel remove_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
Note
Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate f.
- Template Parameters:
ExPolicy – The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.
I – The type of the source iterators used (deduced). This iterator type must meet the requirements of an Forward iterator.
Sent – The type of the end iterators used (deduced). This sentinel type must be a sentinel for I.
O – The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.
T – The type that the result of dereferencing InIter is compared to.
Proj – The type of an optional projection function. This defaults to hpx::identity
- Parameters:
policy – The execution policy to use for the scheduling of the iterations.
first – Refers to the beginning of the sequence of elements the algorithm will be applied to.
last – Refers to the end of the sequence of elements the algorithm will be applied to.
dest – Refers to the beginning of the destination range.
value – Value to be removed.
proj – Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
- Returns:
The ranges::remove_copy algorithm returns a hpx::future<ranges::remove_copy_result<I, O>> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns ranges::remove_copy_result<I, O> otherwise. The ranges::remove_copy algorithm returns an object {last, result + N}, where N is the number of elements copied.
-
template<typename ExPolicy, typename Rng, typename O, typename T, typename Proj = hpx::identity>
parallel::util::detail::algorithm_result<ExPolicy, remove_copy_result<std::ranges::iterator_t<Rng>, O>>::type hpx::ranges::remove_copy(ExPolicy &&policy, Rng &&rng, O dest, T const &value, Proj &&proj = Proj())# Copies the elements in the range, defined by rng, to another range beginning at dest. Copies only the elements for which the comparison operator returns false when compare to val. The order of the elements that are not removed is preserved.
Effects: Copies all the elements referred to by the iterator it in the range [first,last) for which the following corresponding conditions do not hold: INVOKE(proj, *it) == value
The assignments in the parallel remove_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The assignments in the parallel remove_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
Note
Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate f.
- Template Parameters:
ExPolicy – The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.
Rng – The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.
O – The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.
T – The type that the result of dereferencing InIter is compared to.
Proj – The type of an optional projection function. This defaults to hpx::identity
- Parameters:
policy – The execution policy to use for the scheduling of the iterations.
rng – Refers to the sequence of elements the algorithm will be applied to.
dest – Refers to the beginning of the destination range.
value – Value to be removed.
proj – Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
- Returns:
The ranges::remove_copy algorithm returns a hpx::future<remove_copy_result< std::ranges::iterator_t<Rng>, O>> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns remove_copy_result< std::ranges::iterator_t<Rng>, O> otherwise. The ranges::remove_copy algorithm returns an object {last, result + N}, where N is the number of elements copied.