hpx::ranges::find, hpx::ranges::find_if, hpx::ranges::find_if_not, hpx::ranges::find_end, hpx::ranges::find_first_of
hpx::ranges::find, hpx::ranges::find_if, hpx::ranges::find_if_not, hpx::ranges::find_end, hpx::ranges::find_first_of#
Defined in header hpx/algorithm.hpp.
See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx

namespace ranges
Functions

template<typename ExPolicy, typename Iter, typename Sent, typename Proj = hpx::identity, typename T = typename hpx::parallel::traits::projected<Iter, Proj>::value_type>
hpx::parallel::util::detail::algorithm_result_t<ExPolicy, Iter> find(ExPolicy &&policy, Iter first, Sent last, T const &val, Proj &&proj = Proj())# Returns the first element in the range [first, last) that is equal to value
The comparison operations in the parallel find algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The comparison operations in the parallel find 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: At most last  first applications of the operator==().
 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.
Iter – The type of the begin source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.
Sent – The type of the end source iterators used (deduced). This iterator type must meet the requirements of an sentinel for Iter.
T – The type of the value to find (deduced).
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 of the first range the algorithm will be applied to.
last – Refers to the end of the sequence of elements of the first range the algorithm will be applied to.
val – the value to compare the elements to
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 find algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The find algorithm returns the first element in the range [first,last) that is equal to val. If no such element in the range of [first,last) is equal to val, then the algorithm returns last.

template<typename ExPolicy, typename Rng, typename Proj = hpx::identity, typename T = typename hpx::parallel::traits::projected<hpx::traits::range_iterator_t<Rng>, Proj>::value_type>
hpx::parallel::util::detail::algorithm_result<ExPolicy, hpx::traits::range_iterator_t<Rng>> find(ExPolicy &&policy, Rng &&rng, T const &val, Proj &&proj = Proj())# Returns the first element in the range [first, last) that is equal to value
The comparison operations in the parallel find algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The comparison operations in the parallel find 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: At most last  first applications of the operator==().
 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.
T – The type of the value to find (deduced).
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.
val – the value to compare the elements to
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 find algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The find algorithm returns the first element in the range [first,last) that is equal to val. If no such element in the range of [first,last) is equal to val, then the algorithm returns last.

template<typename Iter, typename Sent, typename Proj = hpx::identity, typename T = typename hpx::parallel::traits::projected<Iter, Proj>::value_type>
Iter find(Iter first, Sent last, T const &val, Proj &&proj = Proj())# Returns the first element in the range [first, last) that is equal to value
Note
Complexity: At most last  first applications of the operator==().
 Template Parameters
Iter – The type of the begin source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.
Sent – The type of the end source iterators used (deduced). This iterator type must meet the requirements of an sentinel for Iter.
T – The type of the value to find (deduced).
Proj – The type of an optional projection function. This defaults to hpx::identity
 Parameters
first – Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.
last – Refers to the end of the sequence of elements of the first range the algorithm will be applied to.
val – the value to compare the elements to
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 find algorithm returns the first element in the range [first,last) that is equal to val. If no such element in the range of [first,last) is equal to val, then the algorithm returns last.

template<typename Rng, typename Proj = hpx::identity, typename T = typename hpx::parallel::traits::projected<hpx::traits::range_iterator_t<Rng>, Proj>::value_type>
hpx::traits::range_iterator_t<Rng> find(Rng &&rng, T const &val, Proj &&proj = Proj())# Returns the first element in the range [first, last) that is equal to value
The comparison operations in the parallel find algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The comparison operations in the parallel find 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: At most last  first applications of the operator==().
 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.
T – The type of the value to find (deduced).
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.
val – the value to compare the elements to
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 find algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The find algorithm returns the first element in the range [first,last) that is equal to val. If no such element in the range of [first,last) is equal to val, then the algorithm returns last.

template<typename ExPolicy, typename Iter, typename Sent, typename Pred, typename Proj = hpx::identity>
hpx::parallel::util::detail::algorithm_result_t<ExPolicy, Iter> find_if(ExPolicy &&policy, Iter first, Sent last, Pred &&pred, Proj &&proj = Proj())# Returns the first element in the range [first, last) for which predicate pred returns true
The comparison operations in the parallel find_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The comparison operations in the parallel find_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: At most last  first applications of the predicate.
 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.
Iter – The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of a forward iterator.
Sent – The type of the end source iterators used (deduced). This iterator type must meet the requirements of an sentinel for Iter.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal 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.
first – Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.
last – Refers to the end of the sequence of elements of the first range the algorithm will be applied to.
pred – The unary predicate which returns true for the required element. The signature of the 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 objects of type FwdIter 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 find_if algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The find_if algorithm returns the first element in the range [first,last) that satisfies the predicate f. If no such element exists that satisfies the predicate f, the algorithm returns last.

template<typename ExPolicy, typename Rng, typename Pred, typename Proj = hpx::identity>
hpx::parallel::util::detail::algorithm_result<ExPolicy, hpx::traits::range_iterator_t<Rng>> find_if(ExPolicy &&policy, Rng &&rng, Pred &&pred, Proj &&proj = Proj())# Returns the first element in the range rng for which predicate pred returns true
The comparison operations in the parallel find_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The comparison operations in the parallel find_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: At most last  first applications of the predicate.
 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.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal 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.
pred – The unary predicate which returns true for the required element. The signature of the 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 objects of type FwdIter 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 find_if algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The find_if algorithm returns the first element in the range [first,last) that satisfies the predicate f. If no such element exists that satisfies the predicate f, the algorithm returns last.

template<typename Iter, typename Sent, typename Pred, typename Proj = hpx::identity>
Iter find_if(Iter first, Sent last, Pred &&pred, Proj &&proj = Proj())# Returns the first element in the range [first, last) for which predicate pred returns true
Note
Complexity: At most last  first applications of the predicate.
 Template Parameters
Iter – The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of a forward iterator.
Sent – The type of the end source iterators used (deduced). This iterator type must meet the requirements of an sentinel for Iter.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal requires F 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 of the first range the algorithm will be applied to.
last – Refers to the end of the sequence of elements of the first range the algorithm will be applied to.
pred – The unary predicate which returns true for the required element. The signature of the 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 objects of type FwdIter 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 find_if algorithm returns the first element in the range [first,last) that satisfies the predicate f. If no such element exists that satisfies the predicate f, the algorithm returns last.

template<typename Rng, typename Pred, typename Proj = hpx::identity>
hpx::traits::range_iterator_t<Rng> find_if(Rng &&rng, Pred &&pred, Proj &&proj = Proj())# Returns the first element in the range rng for which predicate pred returns true
Note
Complexity: At most last  first applications of the predicate.
 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.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal 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.
pred – The unary predicate which returns true for the required element. The signature of the 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 objects of type FwdIter 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 find_if algorithm returns the first element in the range [first,last) that satisfies the predicate f. If no such element exists that satisfies the predicate f, the algorithm returns last.

template<typename ExPolicy, typename Iter, typename Sent, typename Pred, typename Proj = hpx::identity>
hpx::parallel::util::detail::algorithm_result<ExPolicy, Iter>::type find_if_not(ExPolicy &&policy, Iter first, Sent last, Pred &&pred, Proj &&proj = Proj())# Returns the first element in the range [first, last) for which predicate f returns false
The comparison operations in the parallel find_if_not algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The comparison operations in the parallel find_if_not 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: At most last  first applications of the predicate.
 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.
Iter – The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of a forward iterator.
Sent – The type of the end source iterators used (deduced). This iterator type must meet the requirements of an sentinel for Iter.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal 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.
first – Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.
last – Refers to the end of the sequence of elements of the first range the algorithm will be applied to.
pred – The unary predicate which returns false for the required element. The signature of the 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 objects of type FwdIter 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 find_if_not algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The find_if_not algorithm returns the first element in the range [first, last) that does not satisfy the predicate f. If no such element exists that does not satisfy the predicate f, the algorithm returns last.

template<typename ExPolicy, typename Rng, typename Pred, typename Proj = hpx::identity>
hpx::parallel::util::detail::algorithm_result<ExPolicy, hpx::traits::range_iterator_t<Rng>> find_if_not(ExPolicy &&policy, Rng &&rng, Pred &&pred, Proj &&proj = Proj())# Returns the first element in the range rng for which predicate f returns false
The comparison operations in the parallel find_if_not algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The comparison operations in the parallel find_if_not 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: At most last  first applications of the predicate.
 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.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal 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.
pred – The unary predicate which returns false for the required element. The signature of the 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 objects of type FwdIter 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 find_if_not algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The find_if_not algorithm returns the first element in the range [first, last) that does not satisfy the predicate f. If no such element exists that does not satisfy the predicate f, the algorithm returns last.

template<typename Iter, typename Sent, typename Pred, typename Proj = hpx::identity>
Iter find_if_not(Iter first, Sent last, Pred &&pred, Proj &&proj = Proj())# Returns the first element in the range [first, last) for which predicate f returns false
Note
Complexity: At most last  first applications of the predicate.
 Template Parameters
Iter – The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of a forward iterator.
Sent – The type of the end source iterators used (deduced). This iterator type must meet the requirements of an sentinel for Iter.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal requires F 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 of the first range the algorithm will be applied to.
last – Refers to the end of the sequence of elements of the first range the algorithm will be applied to.
pred – The unary predicate which returns false for the required element. The signature of the 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 objects of type FwdIter 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 find_if_not algorithm returns the first element in the range [first, last) that does not satisfy the predicate f. If no such element exists that does not satisfy the predicate f, the algorithm returns last.

template<typename Rng, typename Pred, typename Proj = hpx::identity>
hpx::traits::range_iterator_t<Rng> find_if_not(Rng &&rng, Pred &&pred, Proj &&proj = Proj())# Returns the first element in the range rng for which predicate f returns false
Note
Complexity: At most last  first applications of the predicate.
 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.
Pred – The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal 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.
pred – The unary predicate which returns false for the required element. The signature of the 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 objects of type FwdIter 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 find_if_not algorithm returns the first element in the range [first, last) that does not satisfy the predicate f. If no such element exists that does not satisfy the predicate f, the algorithm returns last.

template<typename ExPolicy, typename Rng1, typename Rng2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity>
hpx::parallel::util::detail::algorithm_result<ExPolicy, hpx::traits::range_iterator_t<Rng1>> find_end(ExPolicy &&policy, Rng1 &&rng1, Rng2 &&rng2, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())# Returns the last subsequence of elements rng2 found in the range rng using the given predicate f to compare elements.
The comparison operations in the parallel find_end algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The comparison operations in the parallel find_end 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.
This overload of find_end is available if the user decides to provide the algorithm their own predicate op.
Note
Complexity: at most S*(NS+1) comparisons where S = distance(begin(rng2), end(rng2)) and N = distance(begin(rng), end(rng)).
 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.
Rng1 – The type of the first source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.
Rng2 – The type of the second source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.
Pred – The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of replace requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
Proj1 – The type of an optional projection function applied to the first sequence. This defaults to hpx::identity
Proj2 – The type of an optional projection function applied to the second sequence. This defaults to hpx::identity
 Parameters
policy – The execution policy to use for the scheduling of the iterations.
rng1 – Refers to the first sequence of elements the algorithm will be applied to.
rng2 – Refers to the second sequence of elements the algorithm will be applied to.
op – The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:
The signature does not need to have const &, but the function must not modify the objects passed to it. The types Type1 and Type2 must be such that objects of types iterator_t<Rng> and iterator_t<Rng2> can be dereferenced and then implicitly converted to Type1 and Type2 respectively.bool pred(const Type1 &a, const Type2 &b);
proj1 – Specifies the function (or function object) which will be invoked for each of the elements of the first range of type dereferenced iterator_t<Rng1> as a projection operation before the function op is invoked.
proj2 – Specifies the function (or function object) which will be invoked for each of the elements of the second range of type dereferenced iterator_t<Rng2> as a projection operation before the function op is invoked.
 Returns
The find_end algorithm returns a hpx::future<iterator_t<Rng> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns iterator_t<Rng> otherwise. The find_end algorithm returns an iterator to the beginning of the last subsequence rng2 in range rng. If the length of the subsequence rng2 is greater than the length of the range rng, end(rng) is returned. Additionally if the size of the subsequence is empty or no subsequence is found, end(rng) is also returned.

template<typename ExPolicy, typename Iter1, typename Sent1, typename Iter2, typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity>
hpx::parallel::util::detail::algorithm_result_t<ExPolicy, Iter1> find_end(ExPolicy &&policy, Iter1 first1, Sent1 last1, Iter2 first2, Sent2 last2, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())# Returns the last subsequence of elements [first2, last2) found in the range [first1, last1) using the given predicate f to compare elements.
The comparison operations in the parallel find_end algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The comparison operations in the parallel find_end 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.
This overload of find_end is available if the user decides to provide the algorithm their own predicate op.
Note
Complexity: at most S*(NS+1) comparisons where S = distance(first2, last2) and N = distance(first1, last1).
 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.
Iter1 – The type of the begin source iterators for the first sequence used (deduced). This iterator type must meet the requirements of an forward iterator.
Sent1 – The type of the end source iterators for the first sequence used (deduced). This iterator type must meet the requirements of an sentinel for Iter1.
Iter2 – The type of the begin source iterators for the second sequence used (deduced). This iterator type must meet the requirements of an forward iterator.
Sent2 – The type of the end source iterators for the second sequence used (deduced). This iterator type must meet the requirements of an sentinel for Iter2.
Pred – The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of replace requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
Proj1 – The type of an optional projection function applied to the first sequence. This defaults to hpx::identity
Proj2 – The type of an optional projection function applied to the second sequence. This defaults to hpx::identity
 Parameters
policy – The execution policy to use for the scheduling of the iterations.
first1 – Refers to the beginning of the first sequence of elements the algorithm will be applied to.
last1 – Refers to the end of the first sequence of elements the algorithm will be applied to.
first2 – Refers to the beginning of the second sequence of elements the algorithm will be applied to.
last2 – Refers to the end of the second sequence of elements the algorithm will be applied to.
op – The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:
The signature does not need to have const &, but the function must not modify the objects passed to it. The types Type1 and Type2 must be such that objects of types iterator_t<Rng> and iterator_t<Rng2> can be dereferenced and then implicitly converted to Type1 and Type2 respectively.bool pred(const Type1 &a, const Type2 &b);
proj1 – Specifies the function (or function object) which will be invoked for each of the elements of the first range of type dereferenced iterator_t<Rng1> as a projection operation before the function op is invoked.
proj2 – Specifies the function (or function object) which will be invoked for each of the elements of the second range of type dereferenced iterator_t<Rng2> as a projection operation before the function op is invoked.
 Returns
The find_end algorithm returns a hpx::future<iterator_t<Rng> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns iterator_t<Rng> otherwise. The find_end algorithm returns an iterator to the beginning of the last subsequence rng2 in range rng. If the length of the subsequence rng2 is greater than the length of the range rng, end(rng) is returned. Additionally if the size of the subsequence is empty or no subsequence is found, end(rng) is also returned.

template<typename Rng1, typename Rng2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity>
hpx::traits::range_iterator_t<Rng1> find_end(Rng1 &&rng1, Rng2 &&rng2, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())# Returns the last subsequence of elements rng2 found in the range rng using the given predicate f to compare elements.
This overload of find_end is available if the user decides to provide the algorithm their own predicate op.
Note
Complexity: at most S*(NS+1) comparisons where S = distance(begin(rng2), end(rng2)) and N = distance(begin(rng), end(rng)).
 Template Parameters
Rng1 – The type of the first source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.
Rng2 – The type of the second source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.
Pred – The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of replace requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
Proj1 – The type of an optional projection function applied to the first sequence. This defaults to hpx::identity
Proj2 – The type of an optional projection function applied to the second sequence. This defaults to hpx::identity
 Parameters
rng1 – Refers to the first sequence of elements the algorithm will be applied to.
rng2 – Refers to the second sequence of elements the algorithm will be applied to.
op – The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:
The signature does not need to have const &, but the function must not modify the objects passed to it. The types Type1 and Type2 must be such that objects of types iterator_t<Rng> and iterator_t<Rng2> can be dereferenced and then implicitly converted to Type1 and Type2 respectively.bool pred(const Type1 &a, const Type2 &b);
proj1 – Specifies the function (or function object) which will be invoked for each of the elements of the first range of type dereferenced iterator_t<Rng1> as a projection operation before the function op is invoked.
proj2 – Specifies the function (or function object) which will be invoked for each of the elements of the second range of type dereferenced iterator_t<Rng2> as a projection operation before the function op is invoked.
 Returns
The find_end algorithm returns an iterator to the beginning of the last subsequence rng2 in range rng. If the length of the subsequence rng2 is greater than the length of the range rng, end(rng) is returned. Additionally if the size of the subsequence is empty or no subsequence is found, end(rng) is also returned.

template<typename Iter1, typename Sent1, typename Iter2, typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity>
Iter1 find_end(Iter1 first1, Sent1 last1, Iter2 first2, Sent2 last2, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())# Returns the last subsequence of elements [first2, last2) found in the range [first1, last1) using the given predicate f to compare elements.
This overload of find_end is available if the user decides to provide the algorithm their own predicate op.
Note
Complexity: at most S*(NS+1) comparisons where S = distance(first2, last2) and N = distance(first1, last1).
 Template Parameters
Iter1 – The type of the begin source iterators for the first sequence used (deduced). This iterator type must meet the requirements of an forward iterator.
Sent1 – The type of the end source iterators for the first sequence used (deduced). This iterator type must meet the requirements of an sentinel for Iter1.
Iter2 – The type of the begin source iterators for the second sequence used (deduced). This iterator type must meet the requirements of an forward iterator.
Sent2 – The type of the end source iterators for the second sequence used (deduced). This iterator type must meet the requirements of an sentinel for Iter2.
Pred – The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of replace requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
Proj1 – The type of an optional projection function applied to the first sequence. This defaults to hpx::identity
Proj2 – The type of an optional projection function applied to the second sequence. This defaults to hpx::identity
 Parameters
first1 – Refers to the beginning of the first sequence of elements the algorithm will be applied to.
last1 – Refers to the end of the first sequence of elements the algorithm will be applied to.
first2 – Refers to the beginning of the second sequence of elements the algorithm will be applied to.
last2 – Refers to the end of the second sequence of elements the algorithm will be applied to.
op – The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:
The signature does not need to have const &, but the function must not modify the objects passed to it. The types Type1 and Type2 must be such that objects of types iterator_t<Rng> and iterator_t<Rng2> can be dereferenced and then implicitly converted to Type1 and Type2 respectively.bool pred(const Type1 &a, const Type2 &b);
proj1 – Specifies the function (or function object) which will be invoked for each of the elements of the first range of type dereferenced iterator_t<Rng1> as a projection operation before the function op is invoked.
proj2 – Specifies the function (or function object) which will be invoked for each of the elements of the second range of type dereferenced iterator_t<Rng2> as a projection operation before the function op is invoked.
 Returns
The find_end algorithm returns an iterator to the beginning of the last subsequence rng2 in range rng. If the length of the subsequence rng2 is greater than the length of the range rng, end(rng) is returned. Additionally if the size of the subsequence is empty or no subsequence is found, end(rng) is also returned.

template<typename ExPolicy, typename Rng1, typename Rng2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity>
hpx::parallel::util::detail::algorithm_result<ExPolicy, hpx::traits::range_iterator_t<Rng1>> find_first_of(ExPolicy &&policy, Rng1 &&rng1, Rng2 &&rng2, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())# Searches the range rng1 for any elements in the range rng2. Uses binary predicate p to compare elements
The comparison operations in the parallel find_first_of algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The comparison operations in the parallel find_first_of 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.
This overload of find_first_of is available if the user decides to provide the algorithm their own predicate op.
Note
Complexity: at most (S*N) comparisons where S = distance(begin(rng2), end(rng2)) and N = distance(begin(rng1), end(rng1)).
 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.
Rng1 – The type of the first source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.
Rng2 – The type of the second source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.
Pred – The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of replace requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
Proj1 – The type of an optional projection function. This defaults to hpx::identity and is applied to the elements in rng1.
Proj2 – The type of an optional projection function. This defaults to hpx::identity and is applied to the elements in rng2.
 Parameters
policy – The execution policy to use for the scheduling of the iterations.
rng1 – Refers to the first sequence of elements the algorithm will be applied to.
rng2 – Refers to the second sequence of elements the algorithm will be applied to.
op – The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:
The signature does not need to have const &, but the function must not modify the objects passed to it. The types Type1 and Type2 must be such that objects of types iterator_t<Rng1> and iterator_t<Rng2> can be dereferenced and then implicitly converted to Type1 and Type2 respectively.bool pred(const Type1 &a, const Type2 &b);
proj1 – Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced iterator_t<Rng1> before the function op is invoked.
proj2 – Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced iterator_t<Rng2> before the function op is invoked.
 Returns
The find_end algorithm returns a hpx::future<iterator_t<Rng1> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns iterator_t<Rng1> otherwise. The find_first_of algorithm returns an iterator to the first element in the range rng1 that is equal to an element from the range rng2. If the length of the subsequence rng2 is greater than the length of the range rng1, end(rng1) is returned. Additionally if the size of the subsequence is empty or no subsequence is found, end(rng1) is also returned.

template<typename ExPolicy, typename Iter1, typename Sent1, typename Iter2, typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity>
hpx::parallel::util::detail::algorithm_result_t<ExPolicy, Iter1> find_first_of(ExPolicy &&policy, Iter1 first1, Sent1 last1, Iter2 first2, Sent2 last2, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())# Searches the range [first1, last1) for any elements in the range [first2, last2). Uses binary predicate p to compare elements
The comparison operations in the parallel find_first_of algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The comparison operations in the parallel find_first_of 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.
This overload of find_first_of is available if the user decides to provide the algorithm their own predicate op.
Note
Complexity: at most (S*N) comparisons where S = distance(first2, last2) and N = distance(first1, last1).
 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.
Iter1 – The type of the begin source iterators for the first sequence used (deduced). This iterator type must meet the requirements of an forward iterator.
Sent1 – The type of the end source iterators for the first sequence used (deduced). This iterator type must meet the requirements of an sentinel for Iter1.
Iter2 – The type of the begin source iterators for the second sequence used (deduced). This iterator type must meet the requirements of an forward iterator.
Sent2 – The type of the end source iterators for the second sequence used (deduced). This iterator type must meet the requirements of an sentinel for Iter2.
Pred – The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of replace requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
Proj1 – The type of an optional projection function. This defaults to hpx::identity and is applied to the elements in rng1.
Proj2 – The type of an optional projection function. This defaults to hpx::identity and is applied to the elements in rng2.
 Parameters
policy – The execution policy to use for the scheduling of the iterations.
first1 – Refers to the beginning of the first sequence of elements the algorithm will be applied to.
last1 – Refers to the end of the first sequence of elements the algorithm will be applied to.
first2 – Refers to the beginning of the second sequence of elements the algorithm will be applied to.
last2 – Refers to the end of the second sequence of elements the algorithm will be applied to.
op – The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:
The signature does not need to have const &, but the function must not modify the objects passed to it. The types Type1 and Type2 must be such that objects of types iterator_t<Rng1> and iterator_t<Rng2> can be dereferenced and then implicitly converted to Type1 and Type2 respectively.bool pred(const Type1 &a, const Type2 &b);
proj1 – Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced iterator_t<Rng1> before the function op is invoked.
proj2 – Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced iterator_t<Rng2> before the function op is invoked.
 Returns
The find_end algorithm returns a hpx::future<iterator_t<Rng1> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns iterator_t<Rng1> otherwise. The find_first_of algorithm returns an iterator to the first element in the range rng1 that is equal to an element from the range rng2. If the length of the subsequence rng2 is greater than the length of the range rng1, end(rng1) is returned. Additionally if the size of the subsequence is empty or no subsequence is found, end(rng1) is also returned.

template<typename Rng1, typename Rng2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity>
hpx::traits::range_iterator_t<Rng1> find_first_of(Rng1 &&rng1, Rng2 &&rng2, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())# Searches the range rng1 for any elements in the range rng2. Uses binary predicate p to compare elements
This overload of find_first_of is available if the user decides to provide the algorithm their own predicate op.
Note
Complexity: at most (S*N) comparisons where S = distance(begin(rng2), end(rng2)) and N = distance(begin(rng1), end(rng1)).
 Template Parameters
Rng1 – The type of the first source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.
Rng2 – The type of the second source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.
Pred – The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of replace requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
Proj1 – The type of an optional projection function. This defaults to hpx::identity and is applied to the elements in rng1.
Proj2 – The type of an optional projection function. This defaults to hpx::identity and is applied to the elements in rng2.
 Parameters
rng1 – Refers to the first sequence of elements the algorithm will be applied to.
rng2 – Refers to the second sequence of elements the algorithm will be applied to.
op – The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:
The signature does not need to have const &, but the function must not modify the objects passed to it. The types Type1 and Type2 must be such that objects of types iterator_t<Rng1> and iterator_t<Rng2> can be dereferenced and then implicitly converted to Type1 and Type2 respectively.bool pred(const Type1 &a, const Type2 &b);
proj1 – Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced iterator_t<Rng1> before the function op is invoked.
proj2 – Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced iterator_t<Rng2> before the function op is invoked.
 Returns
The find_first_of algorithm returns an iterator to the first element in the range rng1 that is equal to an element from the range rng2. If the length of the subsequence rng2 is greater than the length of the range rng1, end(rng1) is returned. Additionally if the size of the subsequence is empty or no subsequence is found, end(rng1) is also returned.

template<typename Iter1, typename Sent1, typename Iter2, typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity>
Iter1 find_first_of(Iter1 first1, Sent1 last1, Iter2 first2, Sent2 last2, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())# Searches the range [first1, last1) for any elements in the range [first2, last2). Uses binary predicate p to compare elements
This overload of find_first_of is available if the user decides to provide the algorithm their own predicate op.
Note
Complexity: at most (S*N) comparisons where S = distance(first2, last2) and N = distance(first1, last1).
 Template Parameters
Iter1 – The type of the begin source iterators for the first sequence used (deduced). This iterator type must meet the requirements of an forward iterator.
Sent1 – The type of the end source iterators for the first sequence used (deduced). This iterator type must meet the requirements of an sentinel for Iter1.
Iter2 – The type of the begin source iterators for the second sequence used (deduced). This iterator type must meet the requirements of an forward iterator.
Sent2 – The type of the end source iterators for the second sequence used (deduced). This iterator type must meet the requirements of an sentinel for Iter2.
Pred – The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of replace requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
Proj1 – The type of an optional projection function. This defaults to hpx::identity and is applied to the elements in rng1.
Proj2 – The type of an optional projection function. This defaults to hpx::identity and is applied to the elements in rng2.
 Parameters
first1 – Refers to the beginning of the first sequence of elements the algorithm will be applied to.
last1 – Refers to the end of the first sequence of elements the algorithm will be applied to.
first2 – Refers to the beginning of the second sequence of elements the algorithm will be applied to.
last2 – Refers to the end of the second sequence of elements the algorithm will be applied to.
op – The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:
The signature does not need to have const &, but the function must not modify the objects passed to it. The types Type1 and Type2 must be such that objects of types iterator_t<Rng1> and iterator_t<Rng2> can be dereferenced and then implicitly converted to Type1 and Type2 respectively.bool pred(const Type1 &a, const Type2 &b);
proj1 – Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced iterator_t<Rng1> before the function op is invoked.
proj2 – Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced iterator_t<Rng2> before the function op is invoked.
 Returns
The find_first_of algorithm returns an iterator to the first element in the range rng1 that is equal to an element from the range rng2. If the length of the subsequence rng2 is greater than the length of the range rng1, end(rng1) is returned. Additionally if the size of the subsequence is empty or no subsequence is found, end(rng1) is also returned.

template<typename ExPolicy, typename Iter, typename Sent, typename Proj = hpx::identity, typename T = typename hpx::parallel::traits::projected<Iter, Proj>::value_type>

namespace ranges