hpx::ranges::remove_copy_if#
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 Pred, typename Proj = hpx::identity>
remove_copy_if_result<I, O> hpx::ranges::remove_copy_if(I first, Sent last, O dest, Pred &&pred, 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 predicate pred returns false. 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(pred, INVOKE(proj, *it)) != false.
The assignments in the parallel remove_copy_if 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.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of remove_copy_if requires Pred to meet the requirements of CopyConstructible.
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.
pred – Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the elements to be removed. The signature of this predicate should be equivalent to:
The signature does not need to have const&, but the function must not modify the objects passed to it. The type Type must be such that an object of type InIter can be dereferenced and then implicitly converted to Type.bool pred(const Type &a);
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_if algorithm returns ranges::remove_copy_if_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 Pred, typename Proj = hpx::identity>
remove_copy_if_result<std::ranges::iterator_t<Rng>, O> hpx::ranges::remove_copy_if(Rng &&rng, O dest, Pred &&pred, 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 predicate pred returns false. 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 rng for which the following corresponding conditions do not hold: INVOKE(pred, INVOKE(proj, *it)) != false.
The assignments in the parallel remove_copy_if 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 pred.
- 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.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of copy_if requires F to meet the requirements of CopyConstructible.
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.
pred – Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the elements to be removed. The signature of this predicate should be equivalent to:
The signature does not need to have const&, but the function must not modify the objects passed to it. The type Type must be such that an object of type InIter can be dereferenced and then implicitly converted to Type.bool pred(const Type &a);
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_if algorithm returns a remove_copy_if_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 Pred, typename Proj = hpx::identity>
parallel::util::detail::algorithm_result<ExPolicy, remove_copy_if_result<I, O>>::type hpx::ranges::remove_copy_if(ExPolicy &&policy, I first, Sent last, O dest, Pred &&pred, 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 predicate pred returns false. 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(pred, INVOKE(proj, *it)) != false.
The assignments in the parallel remove_copy_if 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_if 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.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of remove_copy_if requires Pred to meet the requirements of CopyConstructible.
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.
pred – Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the elements to be removed. The signature of this predicate should be equivalent to:
The signature does not need to have const&, but the function must not modify the objects passed to it. The type Type must be such that an object of type InIter can be dereferenced and then implicitly converted to Type.bool pred(const Type &a);
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_if algorithm returns a hpx::future<ranges::remove_copy_if_result<I, O>> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns ranges::remove_copy_if_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 Pred, typename Proj = hpx::identity>
parallel::util::detail::algorithm_result<ExPolicy, remove_copy_if_result<std::ranges::iterator_t<Rng>, O>>::type hpx::ranges::remove_copy_if(ExPolicy &&policy, Rng &&rng, O dest, Pred &&pred, 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 predicate pred returns false. 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 rng for which the following corresponding conditions do not hold: INVOKE(pred, INVOKE(proj, *it)) != false.
The assignments in the parallel remove_copy_if 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_if 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 pred.
- 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.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of copy_if requires F to meet the requirements of CopyConstructible.
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.
pred – Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the elements to be removed. The signature of this predicate should be equivalent to:
The signature does not need to have const&, but the function must not modify the objects passed to it. The type Type must be such that an object of type InIter can be dereferenced and then implicitly converted to Type.bool pred(const Type &a);
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_if algorithm returns a hpx::future<remove_copy_if_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_if_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.