namespace std {
// specialized algorithms
template<class ExecutionPolicy,
class InputIterator, class ForwardIterator>
ForwardIterator uninitialized_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
ForwardIterator result);
template<class ExecutionPolicy,
class ForwardIterator, class T>
void uninitialized_fill(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last
const T& x);
template<class ExecutionPolicy,
class ForwardIterator, class Size>
ForwardIterator uninitialized_fill_n(ExecutionPolicy &&exec,
ForwardIterator first, Size n,
const T& x);
}
template<class ExecutionPolicy,
class InputIterator, class ForwardIterator>
ForwardIterator uninitialized_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
ForwardIterator result);
template<class ExecutionPolicy,
class InputIterator, class Size, class ForwardIterator>
ForwardIterator uninitialized_copy_n(ExecutionPolicy &&exec,
InputIterator first, Size n,
ForwardIterator result);
-
Effects: Copy constructs the element referenced by every iterator
i
in the range[result,result + (last - first))
as if by the expression::new (static_cast<void*>(&*i)) typename iterator_traits<ForwardIterator>::value_type(*(first + (i - result)))
The execution of the algorithm is parallelized as determined by
exec
. -
Returns:
result + (last - first)
. -
Complexity:
O(last - first)
. -
Remarks: Neither signature shall participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class Size, class ForwardIterator>
ForwardIterator uninitialized_copy_n(ExecutionPolicy &&exec,
InputIterator first, Size n,
ForwardIterator result);
-
Effects: Copy constructs the element referenced by every iterator
i
in the range[result,result + n)
as if by the expression::new (static_cast<void*>(&*i)) typename iterator_traits<ForwardIterator>::value_type(*(first + (i - result)))
The execution of the algorithm is parallelized as determined by
exec
. -
Returns:
result + n
. -
Complexity:
O(n)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator, class T>
void uninitialized_fill(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last
const T& x);
-
Effects: Copy constructs the element referenced by every iterator
i
in the range[first,last)
as if by the expression::new (static_cast<void*>(&*i)) typename iterator_traits<ForwardIterator>::value_type(x)
The execution of the algorithm is parallelized as determined by
exec
. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator, class Size>
ForwardIterator uninitialized_fill_n(ExecutionPolicy &&exec,
ForwardIterator first, Size n,
const T& x);
-
Effects: Copy constructs the element referenced by every iterator
i
in the range[first,first + n)
as if by the expression::new (static_cast<void*>(&*i)) typename iterator_traits<ForwardIterator>::value_type(x)
The execution of the algorithm is parallelized as determined by
exec
. -
Returns:
first + n
. -
Complexity:
O(n)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
namespace std {
// non-modifying sequence operations:
template<class ExecutionPolicy,
class InputIterator, class Predicate>
bool all_of(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, Predicate pred);
template<class ExecutionPolicy,
class InputIterator, class Predicate>
bool any_of(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, Predicate pred);
template<class ExecutionPolicy,
class InputIterator, class Predicate>
bool none_of(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, Predicate pred);
template<class ExecutionPolicy,
class InputIterator, class T>
InputIterator find(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
const T& value);
template<class ExecutionPolicy,
class InputIterator, class Predicate>
InputIterator find_if(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
Predicate pred);
template<class ExecutionPolicy,
class InputIterator, class Predicate>
InputIterator find_if_not(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
Predicate pred);
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2>
ForwardIterator1
find_end(ExecutionPolicy &exec,
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2);
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2,
class BinaryPredicate>
ForwardIterator1
find_end(ExecutionPolicy &&exec,
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2,
BinaryPredicate pred);
template<class ExecutionPolicy,
class InputIterator, class ForwardIterator>
InputIterator
find_first_of(ExecutionPolicy &&exec,
InputIterator first1, InputIterator last1,
ForwardIterator first2, ForwardIterator last2);
template<class ExecutionPolicy,
class InputIterator, class ForwardIterator,
class BinaryPredicate>
InputIterator
find_first_of(ExecutionPolicy &&exec,
InputIterator first1, InputIterator last1,
ForwardIterator first2, ForwardIterator last2,
BinaryPredicate pred);
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator adjacent_find(ExecutionPolicy &&exec, ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, class BinaryPredicate>
ForwardIterator adjacent_find(ExecutionPolicy &&exec, ForwardIterator first, ForwardIterator last,
BinaryPredicate pred);
template<class ExecutionPolicy,
class InputIterator, class EqualityComparable>
typename iterator_traits<InputIterator>::difference_type
count(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, const EqualityComparable &value);
template<class ExecutionPolicy,
class InputIterator, class Predicate>
typename iterator_traits<InputIterator>::difference_type
count_if(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, Predicate pred);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2>
pair<InputIterator1,InputIterator2>
mismatch(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class BinaryPredicate>
pair<InputIterator1,InputIterator2>
mismatch(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, BinaryPredicate pred);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2>
bool equal(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class BinaryPredicate>
bool equal(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, BinaryPredicate pred);
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2>
ForwardIterator1 search(ExecutionPolicy &&exec,
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2);
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2,
class BinaryPredicate>
ForwardIterator1 search(ExecutionPolicy &&exec,
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2,
BinaryPredicate pred);
template<class ExecutionPolicy,
class ForwardIterator, class Size, class T>
ForwardIterator search_n(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, Size count,
const T& value);
template<class ExecutionPolicy,
class ForwardIterator, class Size, class T, class BinaryPredicate>
ForwardIterator search_n(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, Size count,
const T& value, BinaryPredicate pred);
// modifying sequence operations:
// copy:
template<class ExecutionPolicy,
class InputIterator, class OutputIterator>
OutputIterator copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator, class Size, class OutputIterator>
OutputIterator copy_n(ExecutionPolicy &&exec,
InputIterator first, Size n,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class Predicate>
OutputIterator
copy_if(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result, Predicate pred);
// move:
template<class ExecutionPolicy,
class InputIterator, class OutputIterator>
OutputIterator
move(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result);
// swap:
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2>
ForwardIterator2
swap_ranges(ExecutionPolicy &&exec,
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator1 first2);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator,
class UnaryOperation>
OutputIterator transform(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result, UnaryOperation op);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class OutputIterator,
class BinaryOperation>
OutputIterator
transform(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, OutputIterator result,
BinaryOperation binary_op);
template<class ExecutionPolicy,
class ForwardIterator, class T>
void replace(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
const T& old_value, const T& new_value);
template<class ExecutionPolicy,
class ForwardIterator, class Predicate, class T>
void replace_if(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
Predicate pred, const T& new_value);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class T>
OutputIterator
replace_copy(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
OutputIterator result,
const T& old_value, const T& new_value);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class Predicate, class T>
OutputIterator
replace_copy_if(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result,
template<class ExecutionPolicy,
class ForwardIterator, class T>
void fill(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, const T& value);
template<class ExecutionPolicy,
class OutputIterator, class Size, class T>
void fill_n(ExecutionPolicy &&exec,
OutputIterator first, Size n, const T& value);
template<class ExecutionPolicy,
class ForwardIterator, class Generator>
void generate(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, Generator gen);
template<class ExecutionPolicy,
class OutputIterator, class Size, class Generator>
OutputIterator generate_n(ExecutionPolicy &&exec,
OutputIterator first, Size n, Generator gen);
template<class ExecutionPolicy,
class ForwardIterator, class T>
ForwardIterator remove(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, const T& value);
template<class ExecutionPolicy,
class ForwardIterator, class Predicate>
ForwardIterator remove_if(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, Predicate pred);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class T>
OutputIterator
remove_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result, const T& value);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class Predicate>
OutputIterator
remove_copy_if(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result, Predicate pred);
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator unique(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, typename BinaryPredicate>
ForwardIterator unique(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last
BinaryPredicate pred);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator>
OutputIterator
unique_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class BinaryPredicate>
OutputIterator
unique_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result, BinaryPredicate pred);
template<class ExecutionPolicy,
class BidirectionalIterator>
void reverse(ExecutionPolicy &&exec,
BidirectionalIterator first, BidirectionalIterator last);
template<class ExecutionPolicy,
class BidirectionalIterator, class OutputIterator>
OutputIterator
reverse_copy(ExecutionPolicy &&exec,
BidirectionalIterator first,
BidirectionalIterator last, OutputIterator result);
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator rotate(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator middle,
ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, class OutputIterator>
OutputIterator
rotate_copy(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator middle,
ForwardIterator last, OutputIterator result);
// partitions:
template<class ExecutionPolicy,
class InputIterator, class Predicate>
bool is_partitioned(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, Predicate pred);
template<class ExecutionPolicy,
class ForwardIterator, class Predicate>
ForwardIterator
partition(ExecutionPolicy &&exec,
ForwardIterator first,
ForwardIterator last, Predicate pred);
template<class ExecutionPolicy,
class BidirectionalIterator, class Predicate>
BidirectionalIterator
stable_partition(ExecutionPolicy &&exec,
BidirectionalIterator first,
BidirectionalIterator last, Predicate pred);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator1,
class OutputIterator2, class Predicate>
pair<OutputIterator1, OutputIterator2>
partition_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator1 out_true, OutputIterator2 out_false,
Predicate pred);
template<class ExecutionPolicy,
class ForwardIterator, class Predicate>
ForwardIterator partition_point(ExecutionPolicy &&exec,
ForwardIterator first,
ForwardIterator last,
Predicate pred);
// sorting and related operations:
// sorting:
template<class ExecutionPolicy,
class RandomAccessIterator>
void sort(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator last);
template<class ExecutionPolicy,
class RandomAccessIterator, class Compare>
void sort(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator last, Compare comp);
template<class ExecutionPolicy,
class RandomAccessIterator>
void stable_sort(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator last);
template<class ExecutionPolicy,
class RandomAccessIterator, class Compare>
void stable_sort(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator last,
Compare comp);
template<class ExecutionPolicy,
class RandomAccessIterator>
void partial_sort(ExecutionPolicy &&exec,
RandomAccessIterator first,
RandomAccessIterator middle,
RandomAccessIterator last);
template<class ExecutionPolicy,
class RandomAccessIterator, class Compare>
void partial_sort(ExecutionPolicy &&exec,
RandomAccessIterator first,
RandomAccessIterator middle,
RandomAccessIterator last,
Compare comp);
template<class ExecutionPolicy,
class InputIterator, class RandomAccessIterator>
RandomAccessIterator
partial_sort_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
RandomAccessIterator result_first,
RandomAccessIterator result_last);
template<class ExecutionPolicy,
class InputIterator, class RandomAccessIterator,
class Compare>
RandomAccessIterator
partial_sort_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
RandomAccessIterator result_first,
RandomAccessIterator result_last,
Compare comp);
template<class ExecutionPolicy,
class ForwardIterator>
bool is_sorted(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, class Compare>
bool is_sorted(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
Compare comp);
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator is_sorted_until(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, class Compare>
ForwardIterator is_sorted_until(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
Compare comp);
template<class ExecutionPolicy,
class RandomAccessIterator>
void nth_element(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator nth,
RandomAccessIterator last);
template<class ExecutionPolicy,
class RandomAccessIterator, class Compare>
void nth_element(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator nth,
RandomAccessIterator last, Compare comp);
// merge:
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator>
OutputIterator
merge(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator, class Compare>
OutputIterator
merge(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result, Compare comp);
template<class ExecutionPolicy,
class BidirectionalIterator>
void inplace_merge(ExecutionPolicy &&exec,
BidirectionalIterator first,
BidirectionalIterator middle,
BidirectionalIterator last);
template<class ExecutionPolicy,
class BidirectionalIterator,
class Compare>
void inplace_merge(ExecutionPolicy &&exec,
BidirectionalIterator first,
BidirectionalIterator middle,
BidirectionalIterator last, Compare comp);
// set operations:
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2>
bool includes(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class Compare>
bool includes(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
Compare comp);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator>
OutputIterator
set_union(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator, class Compare>
OutputIterator
set_union(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result, Compare comp);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator>
OutputIterator
set_intersection(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator, class Compare>
OutputIterator
set_intersection(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result, Compare comp);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator>
OutputIterator
set_difference(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator, class Compare>
OutputIterator
set_difference(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result, Compare comp);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator>
OutputIterator
set_symmetric_difference(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator, class Compare>
OutputIterator
set_symmetric_difference(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result, Compare comp);
// minimum and maximum:
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator min_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
Compare comp);
template<class ExecutionPolicy,
class ForwardIterator, class Compare>
ForwardIterator min_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
Compare comp);
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator max_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, class Compare>
ForwardIterator max_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
template<class ExecutionPolicy,
class ForwardIterator>
pair<ForwardIterator, ForwardIterator>
minmax_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, class Compare>
pair<ForwardIterator, ForwardIterator>
minmax_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, Compare comp);
Compare comp);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2>
bool
lexicographical_compare(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class Compare>
bool
lexicographical_compare(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
Compare comp);
}
template<class ExecutionPolicy,
class InputIterator, class Predicate>
bool all_of(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, Predicate pred);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns:
true
if[first,last)
is empty orpred(*i)
is true for every iteratori
in the range[first,last)
andfalse
otherwise. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class Predicate>
bool any_of(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, Predicate pred);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns:
false
if[first,last)
is empty or if there is no iteratori
in the range[first,last)
such thatpred(*i)
istrue
, andtrue
otherwise. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class Predicate>
bool none_of(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, Predicate pred);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns:
true
if[first,last)
is empty or ifpred(*i)
isfalse
for every iteratori
in the range[first,last)
, andfalse
otherwise. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class T>
InputIterator find(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
const T& value);
template<class ExecutionPolicy,
class InputIterator, class Predicate>
InputIterator find_if(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
Predicate pred);
template<class ExecutionPolicy,
class InputIterator, class Predicate>
InputIterator find_if_not(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
Predicate pred);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: The first iterator
i
in the range[first,last)
for which the following corresponding expression holds:*i == value
,pred(*i) != false
,pred(*i) == false
. Returnslast
if no such iterator is found. -
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2>
ForwardIterator1
find_end(ExecutionPolicy &exec,
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2);
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2,
class BinaryPredicate>
ForwardIterator1
find_end(ExecutionPolicy &&exec,
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2,
BinaryPredicate pred);
-
*Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: The last iterator
i
in the range[first1,last1 - (last2 - first2))
such that for any non-negative integern < (last2 - first2)
, the following corresponding conditions hold:*(i + n) == *(first2 + n)
,pred(*(i + n), *(first2 + n)) != false
. Returnslast1
if[first2,last2)
is empty or if no such iterator is found. -
Requires: Neither
operator==
norpred
shall invalidate iterators or subranges, nor modify elements in the ranges[first1,last1)1 or
[first2,last2)`. -
Complexity:
O(m * n)
, wherem == last2 - first1
andn = last1 - first1 - (last2 - first2)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class ForwardIterator>
InputIterator
find_first_of(ExecutionPolicy &&exec,
InputIterator first1, InputIterator last1,
ForwardIterator first2, ForwardIterator last2);
template<class ExecutionPolicy,
class InputIterator, class ForwardIterator,
class BinaryPredicate>
InputIterator
find_first_of(ExecutionPolicy &&exec,
InputIterator first1, InputIterator last1,
ForwardIterator first2, ForwardIterator last2,
BinaryPredicate pred);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: The first iterator
i
in the range[first1,last1)
such that for some iteratorj
in the range[first2,last2)
the following conditions hold:*i == *j
,pred(*i,*j) != false
. Returnslast1
if[first2,last2)
is empty or if no such iterator is found. -
Requires: Neither
operator==
norpred
shall invalidate iterators or subranges, nor modify elements in the ranges[first1,last1)
or[first2,last2)
. -
Complexity:
O(m * n)
, wherem == last1 - first1
andn == last2 - first2
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator adjacent_find(ExecutionPolicy &&exec, ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, class BinaryPredicate>
ForwardIterator adjacent_find(ExecutionPolicy &&exec, ForwardIterator first, ForwardIterator last,
BinaryPredicate pred);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: The first iterator
i
such that bothi
andi + 1
are in the range[first,last)
for which the following corresponding conditions hold:*i == *(i + 1)
,pred(*i, *(i + 1)) != false
. Returnslast
if no such iterator is found. -
Requires: Neither
operator==
norpred
shall invalidate iterators or subranges, nor modify elements in the range[first,last)
. -
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class EqualityComparable>
typename iterator_traits<InputIterator>::difference_type
count(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, const EqualityComparable &value);
template<class ExecutionPolicy,
class InputIterator, class Predicate>
typename iterator_traits<InputIterator>::difference_type
count_if(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, Predicate pred);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: The number of iterators
i
in the range[first,last)
for which the following corresponding conditions hold:*i == value
,pred(*i) != false
. -
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2>
pair<InputIterator1,InputIterator2>
mismatch(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class BinaryPredicate>
pair<InputIterator1,InputIterator2>
mismatch(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, BinaryPredicate pred);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: A pair of iterators
i
andj
such thatj == first2 + (i - first)
andi
is the first iterator in the range[first1,last1)
for which the following corresponding conditions hold:!(i == *(first2 + (i - first1))) pred(*i, *(first2 + (i - first1))) == false
Returns the pair
last1
andfirst2 + (last1 - first1)
if such an iteratori
is not found. -
Complexity:
O(last1 - first1)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2>
bool equal(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class BinaryPredicate>
bool equal(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, BinaryPredicate pred);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns:
true
if for every iteratori
in the range[first1,last1)
the following corresponding conditions hold:*i == *(first2 + (i - first1))
,pred(*i, *(first2 + (i - first1))) != false
. Otherwise, returnsfalse
. -
Complexity:
O(last1 - first1)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2>
ForwardIterator1 search(ExecutionPolicy &&exec,
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2);
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
ForwardIterator1 search(ExecutionPolicy &&exec,
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2,
BinaryPredicate pred);
-
Effects: Finds a subsequence of equal values in a sequence.
The algorithm's execution is parallelized as determined by
exec
. -
Returns: The first iterator
i
in the range[first1,last1 - (last2-first2)
such that for any non-negative integern
less thanlast2 - first2
the following corresponding conditions hold:*(i + n) == *(first2 + n), pred(*(i + n), *(first2 + n)) != false
. Returnsfirst1
if[first2,last2)
is empty, otherwise returnslast1
if no such iterator is found. -
Complexity:
O((last1 - first1) * (last2 - first2))
.
template<class ExecutionPolicy,
class ForwardIterator, class Size, class T>
ForwardIterator search_n(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, Size count,
const T& value);
template<class ExecutionPolicy,
class ForwardIterator, class Size, class T,
class BinaryPredicate>
ForwardIterator search_n(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, Size count,
const T& value, BinaryPredicate pred);
-
Requires: The type
Size
shall be convertible to integral type. -
Effects: Finds a subsequence of equal values in a sequence.
The algorithm's execution is parallelized as determined by
exec
. -
Returns: The first iterator
i
in the range[first,last-count)
such that for any non-negative integern
less thancount
the following corresponding conditions hold:*(i + n) == value, pred(*(i + n),value) != false
. Returnslast
if no such iterator is found. -
Complexity:
O(last - first)
.
template<class ExecutionPolicy,
class InputIterator, class OutputIterator>
OutputIterator copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result);
-
Effects: For each iterator
i
in the range[first,last)
, performs*(result + (i - first) = *i
. The algorithm's execution is parallelized as determined byexec
. -
Returns:
result + (last - first)
. -
Requires:
result
shall not be in the range[first,last)
. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class Size, class OutputIterator>
OutputIterator copy_n(ExecutionPolicy &&exec,
InputIterator first, Size n,
OutputIterator result);
-
Effects: For each non-negative integer
i < n
, performs*(result + i) = *(first + i)
. The algorithm's execution is parallelized as determined byexec
. -
Returns:
result + n
. -
Complexity:
O(n)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class Predicate>
OutputIterator
copy_if(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result, Predicate pred);
-
Requires: The ranges
[first,last)
and[result,result + (last - first))
shall not overlap. -
Effects: Copies all of the elements referred to by the iterator
i
in the range[first,last)
for whichpred(*i)
istrue
. The algorithm's execution is parallelized as determined byexec
. -
Complexity:
O(last - first)
. -
Remarks: Stable.
The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class OutputIterator>
OutputIterator
move(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result);
-
Effects: For each iterator
i
in the range[first,last)
, performs*(result + (i - first) = std::move(*i)
. The algorithm's execution is parallelized as determined byexec
. -
Returns:
result - (last - first)
. -
Requires:
result
shall not be in the range[first,last)
. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2>
ForwardIterator2
swap_ranges(ExecutionPolicy &&exec,
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator1 first2);
-
Effects: For each non-negative integer
n < (last1 - first1)
performs:swap(*(first1 + n), *(first2 + n))
. The algorithm's execution is parallelized as determined byexec
. -
Requires: The two ranges
[first1,last1)
and[first2,first2 + (last1 - first1))
shall not overlap.*(first1 + n)
shall be swappable with*(first2 + n)
. -
Returns:
first2 + (last1 - first1)
. -
Complexity:
O(last1 - first1)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class OutputIterator,
class UnaryOperation>
OutputIterator transform(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result, UnaryOperation op);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class OutputIterator,
class BinaryOperation>
OutputIterator
transform(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, OutputIterator result,
BinaryOperation binary_op);
-
Effects: Assigns through every iterator
i
in the range[result,result + (last1 - first1))
a new corresponding value equal toop(*(first1 + (i - result))
orbinary_op(*(first1 + (i - result)), *(first2 + (i - result))
. The algorithm's execution is parallelized as determined byexec
. -
Requires:
op
andbinary_op
shall not invalidate iterators or subranges, or modify elements in the ranges[first1,last1]
,[first2,first2 + (last1 - first1)]
, and[result,result + (last1 - first1)]
. -
Returns:
result + (last1 - first1)
. -
Complexity:
O(last - first)
orO(last1 - first1)
. -
Remarks:
result
may be equal tofirst
in case of unary transform, or tofirst1
orfirst2
in case of binary transform.The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator, class T>
void replace(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
const T& old_value, const T& new_value);
template<class ExecutionPolicy,
class ForwardIterator, class Predicate, class T>
void replace_if(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
Predicate pred, const T& new_value);
-
Requires: The expression
*first = new_value
shall be valid. -
Effects: Substitutes elements referred by the iterator
i
in the range[first,last)
withnew_value
, when the following corresponding conditions hold:*i == old_value
,pred(*i) != false
. The algorithm's execution is parallelized as determined byexec
. -
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class T>
OutputIterator
replace_copy(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
OutputIterator result,
const T& old_value, const T& new_value);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class Predicate, class T>
OutputIterator
replace_copy_if(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result,
Predicate pred, const T& new_value);
-
Requires: The results of the expressions
*first
andnew_value
shall be writable to theresult
output iterator. The ranges[first,last)
and[result,result + (last - first))
shall not overlap. -
Effects: Assigns to every iterator
i
in the range[result,result + (last - first))
eithernew_value
or*(first + (i - result))
depending on whether the following corresponding conditions hold:*(first + (i - result)) == old_value pred(*(first + (i - result))) != false
The algorithm's execution is parallelized as determined by
exec
. -
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator, class T>
void fill(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, const T& value);
template<class ExecutionPolicy,
class OutputIterator, class Size, class T>
void fill_n(ExecutionPolicy &&exec,
OutputIterator first, Size n, const T& value);
-
Requires: The expression
value
shall be writable to the output iterator. The typeSize
shall be convertible to an integral type. -
Effects: The first algorithm assigns
value
through all the iterators in the range[first,last)
. The second value assignsvalue
through all the iterators in the range[first,first + n)
ifn
is positive, otherwise it does nothing. The algorithm is parallelized as determined byexec
. -
Returns:
fill_n
returnsfirst + n
for non-negative values ofn
andfirst
for negative values. -
Complexity:
O(last - first)
orO(n)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator, class Generator>
void generate(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, Generator gen);
template<class ExecutionPolicy,
class OutputIterator, class Size, class Generator>
OutputIterator generate_n(ExecutionPolicy &&exec,
OutputIterator first, Size n, Generator gen);
-
Effects: The first algorithm invokes the function object
gen
and assigns the value ofgen
through all the iterators in the range[first,last)
. The second algorithm invokes the function objectgen
and assigns the return value ofgen
through all the iterators in the range[first,first + n)
ifn
is positive, otherwise it does nothing. The algorithms execution is parallelized as determined byexec
. -
Requires:
gen
takes no arguments,Size
shall be convertible to an integral type. -
Returns:
generate_n
returnsfirst + n
for non-negative values ofn
andfirst
for negative values. -
Complexity:
O(last - first)
orO(n)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator, class T>
ForwardIterator remove(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, const T& value);
template<class ExecutionPolicy,
class ForwardIterator, class Predicate>
ForwardIterator remove_if(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, Predicate pred);
-
Requires: The type of
*first
shall satisfy theMoveAssignable
requirements. -
Effects: Eliminates all the elements referred to by iterator
i
in the range[first,last)
for which the following corresponding conditions hold:*i == value
,pred(*i) != false
. The algorithm's execution is parallelized as determined byexec
. -
Returns: The end of the resulting range.
-
Complexity:
O(last - first)
. -
Remarks: Stable.
The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
. -
Note: Each element in the range
[ret,last)
, whereret
is the returned value, has a valid but unspecified state, because the algorithms can eliminate elements by swapping with or moving from elements that were originally in that range.
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class T>
OutputIterator
remove_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result, const T& value);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class Predicate>
OutputIterator
remove_copy_if(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result, Predicate pred);
-
Requires: The ranges
[first,last)
and[result,result + (last - first))
shall not overlap. The expression*result = *first
shall be valid. -
Effects: Copies all the elements referred to by the iterator
i
in the range[first,last)
for which the following corresponding conditions do not hold:*i == value
,pred(*i) != false
. The algorithm's execution is parallelized as determined byexec
. -
Returns: The end of the resulting range.
-
Complexity:
O(last - first)
. -
Remarks: Stable.
The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator unique(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, typename BinaryPredicate>
ForwardIterator unique(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last
BinaryPredicate pred);
-
Effects: For a nonempty range, eliminates all but the first element from every consecutive group of equivalent elements referred to by the iterator
i
in the range[first + 1,last)
for which the following conditions hold:*(i - 1) == *i
orpred(*(i - 1), *i) != false
. The algorithm's execution is parallelized as determined byexec
. -
Requires: The comparison function shall be an equivalence relation. The type of
*first
shall satisfy theMoveAssignable
requirements. -
Returns: The end of the resulting range.
-
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class OutputIterator>
OutputIterator
unique_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class BinaryPredicate>
OutputIterator
unique_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result, BinaryPredicate pred);
-
Requires: The comparison function shall be an equivalence relation. The ranges
[first,last)
and[result,result + (last-first))
shall not overlap. The expression*result = *first
shall be valid. If neitherInputIterator
norOutputIterator
meets the requirements of forward iterator then the value type ofInputIterator
shall beCopyConstructible
andCopyAssignable
. OtherwiseCopyConstructible
is not required. -
Effects: Copies only the first element from every consecutive group of equal elements referred to by the iterator
i
in the range[first,last)
for which the following corresponding conditions hold:*i == *(i - 1)
orpred(*i, *(i - 1)) != false
. The algorithm's execution is parallelized as determined byexec
. -
Returns: The end of the resulting range.
-
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class BidirectionalIterator>
void reverse(ExecutionPolicy &&exec,
BidirectionalIterator first, BidirectionalIterator last);
-
Effects: For each non-negative integer
i <= (last - first)/2
, appliesiter_swap
to all pairs of iteratorfirst + i
,(last - i) - 1
. The algorithm's execution is parallelized as determined byexec
. -
Requires:
*first
shall be swappable. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class BidirectionalIterator, class OutputIterator>
OutputIterator
reverse_copy(ExecutionPolicy &&exec,
BidirectionalIterator first,
BidirectionalIterator last, OutputIterator result);
-
Effects: Copies the range
[first,last)
to the range[result,result + (last - first))
such that for any non-negative integeri < (last - first)
the following assignment takes place:*(result + (last - first) - i) = *(first + i)
. The algorithm's execution is parallelized as determined byexec
. -
Requires: The ranges
[first,last)
and[result,result + (last - first))
shall not overlap. -
Returns:
result + (last - first)
. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator rotate(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator middle,
ForwardIterator last);
-
Effects: For each non-negative integer
i < (last - first)
, places the element from the positionfirst + i
into positionfirst + (i + (last - middle)) % (last - first)
. The algorithm's execution is parallelized as determined byexec
. -
Returns:
first + (last - middle)
. -
Remarks: This is a left rotate.
The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
. -
Requires:
[first,middle)
and[middle,last)
shall be valid ranges.ForwardIterator
shall satisfy the requirements ofValueSwappable
. The type of*first
shall satisfy the requirements ofMoveConstructible
and the requirements ofMoveAssignable
. -
Complexity:
O(last - first)
.
template<class ExecutionPolicy,
class ForwardIterator, class OutputIterator>
OutputIterator
rotate_copy(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator middle,
ForwardIterator last, OutputIterator result);
-
Effects: Copies the range
[first,last)
to the range[result,result + (last - first))
such that for each non-negative integeri < (last - first)
the following assignment takes place:*(result + i) = *(first + (i + (middle - first)) % (last - first)). The algorithm's execution is parallelized as determined by
exec`. -
Returns:
result + (last - first)
. -
Requires: The ranges
[first,last)
and[result,result + (last - first))
shall not overlap. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class Predicate>
bool is_partitioned(ExecutionPolicy &&exec,
InputIterator first, InputIterator last, Predicate pred);
-
Requires:
InputIterator
's value type shall be convertible toPredicate
's argument type. -
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns:
true
if[first,last)
is empty or if[first,last)
is partitioned bypred
, i.e. if all elements that satisfypred
appear before those that do not. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator, class Predicate>
ForwardIterator
partition(ExecutionPolicy &&exec,
ForwardIterator first,
ForwardIterator last, Predicate pred);
-
Effects: Places all the elements in the range
[first,last)
that satisfypred
before all the elements that do not satisfy it. The algorithm's execution is parallelized as determined byexec
. -
Returns: An iterator
i
such that for any iteratorj
in the range[first,i)
,pred(*j) != false
, and for any iteratork
in the range[i,last)
,pred(*k) == false
. -
Requires:
ForwardIterator
shall satisfy the requirements ofValueSwappable
. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class BidirectionalIterator, class Predicate>
BidirectionalIterator
stable_partition(ExecutionPolicy &&exec,
BidirectionalIterator first,
BidirectionalIterator last, Predicate pred);
-
Effects: Places all the elements in the range
[first,last)
that satisfypred
before all the elements that do not satisfy it. The algorithm's execution is parallelized as determined byexec
. -
Returns: An iterator
i
such that for any iteratorj
in the range[first,i)
,pred(*j) != false
, and for any iteratork
in the range[i,last)
,pred(*k) == false
. The relative order of the elements in both groups is preserved. -
Requires:
BidirectionalIterator
shall satisfy the requirements ofValueSwappable
. The type of*first
shall satisfy the requirements ofMoveConstructible
and ofMoveAssignable
. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class OutputIterator1,
class OutputIterator2, class Predicate>
pair<OutputIterator1, OutputIterator2>
partition_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator1 out_true, OutputIterator2 out_false,
Predicate pred);
-
Requires:
InputIterator
's value type shall beAssignable
, and shall be writable to theout_true
andout_false
OutputIterator
s, and shall be convertible toPredicate
's argument type. The input range shall not overlap with either of the output ranges. -
Effects: For each iterator
i
in[first,last)
, copies*i
to the output range beginning without_true
ifpred(*i)
istrue
, or to the output range beginning without_false
otherwise. The algorithm's execution is parallelized as determined byexec
. -
Returns: A pair
p
such thatp.first
is the end of the output range beginning atout_true
andp.second
is the end of the output range beginning atout_false
. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator, class Predicate>
ForwardIterator partition_point(ExecutionPolicy &&exec,
ForwardIterator first,
ForwardIterator last,
Predicate pred);
-
Requires:
ForwardIterator
's value type shall be convertible toPredicate
's argument type.[first,last)
shall be partitioned bypred
, i.e. all elements that satisfypred
shall appear before those that do not. -
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: An iterator
mid
such thatall_of(first, mid, pred)
andnone_of(mid, last, pred)
are bothtrue
. -
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class RandomAccessIterator>
void sort(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator last);
template<class ExecutionPolicy,
class RandomAccessIterator, class Compare>
void sort(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator last, Compare comp);
-
Effects: Sorts the elements in the range
[first,last)
. The algorithm's execution is parallelized as determined byexec
. -
Requires:
RandomAccessIterator
shall satisfy the requirements ofValueSwappable
. The type of*first
shall satisfy the requirements ofMoveConstructible
and ofMoveAssignable
. -
Complexity:
O(n lg n)
, wheren = last - first
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class RandomAccessIterator>
void stable_sort(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator last);
template<class ExecutionPolicy,
class RandomAccessIterator, class Compare>
void stable_sort(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator last,
Compare comp);
-
Effects: Sorts the elements in the range
[first,last)
. The algorithm's execution is parallelized as determined byexec
. -
Requires:
RandomAccessIterator
shall satisfy the requirements ofValueSwappable
. The type of*first
shall satisfy the requirements ofMoveConstructible
and ofMoveAssignable
. -
Complexity:
O(n lg n)
, wheren = last - first
. -
Remarks: Stable.
The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class RandomAccessIterator>
void partial_sort(ExecutionPolicy &&exec,
RandomAccessIterator first,
RandomAccessIterator middle,
RandomAccessIterator last);
template<class ExecutionPolicy,
class RandomAccessIterator, class Compare>
void partial_sort(ExecutionPolicy &&exec,
RandomAccessIterator first,
RandomAccessIterator middle,
RandomAccessIterator last,
Compare comp);
-
Effects: Places the first
middle - first
sorted elements from the range[first,last)
into the range[first,middle)
. The rest of the elements in the range[middle,last)
are placed in an unspecified order.The algorithm's execution is parallelized as determined by
exec
. -
Requires:
RandomAccessIterator
shall satisfy the requirements ofValueSwappable
. The type of*first
shall satisfy the requirements ofMoveConstructible
and ofMoveAssignable
.middle
shall be in the range[first,last)
. -
Complexity:
O(m lg n)
, wherem = last - first
andn = middle - first
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class RandomAccessIterator>
RandomAccessIterator
partial_sort_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
RandomAccessIterator result_first,
RandomAccessIterator result_last);
template<class ExecutionPolicy,
class InputIterator, class RandomAccessIterator,
class Compare>
RandomAccessIterator
partial_sort_copy(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
RandomAccessIterator result_first,
RandomAccessIterator result_last,
Compare comp);
-
Effects: Places the first
min(last - first, result_last - result_first)
sorted elements into the range[result_first,result_first + min(last - first, result_last - result_first))
.The algorithm's execution is parallelized as determined by
exec
. -
Returns: The smaller of:
result_last
orresult_first + (last - first)
. -
Requires:
RandomAccessIterator
shall satisfy the requirements ofValueSwappable
. The type of*result_first
shall satisfy the requirements ofMoveConstructible
and ofMoveAssignable
. -
Complexity:
O(m lg n)
, wherem = last - first
andn = min(last - first, result_last - result_first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator>
bool is_sorted(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns:
is_sorted_until(forward<ExecutionPolicy>(exec), first, last) == last
-
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator, class Compare>
bool is_sorted(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
Compare comp);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns:
is_sorted_until(forward<ExecutionPolicy>(exec), first, last, comp) == last
-
Complexity:
O(last - first)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator is_sorted_until(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, class Compare>
ForwardIterator is_sorted_until(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
Compare comp);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: If
distance(first, last) < 2)
, returnslast
. Otherwise, returns the last iteratori
in[first,last)
for which the range[first,i)
is sorted. -
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class RandomAccessIterator>
void nth_element(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator nth,
RandomAccessIterator last);
template<class ExecutionPolicy,
class RandomAccessIterator, class Compare>
void nth_element(ExecutionPolicy &&exec,
RandomAccessIterator first, RandomAccessIterator nth,
RandomAccessIterator last, Compare comp);
-
Effects: Reorders the range
[first,last)
such that the element referenced bynth
is the element that would be in that position if the whole range were sorted. Also for any iteratori
in the range[first,nth)
and any iteratorj
in the range[nth,last)
the following corresponding condition holds:!(*j < *i)
orcomp(*j, *i) == false
.The algorithm's execution is parallelized as determined by
exec
. -
Requires:
RandomAccessIterator
shall satisfy the requirements ofValueSwappable
. The type of*first
shall satisfy the requirements ofMoveConstructible
and ofMoveAssignable
.nth
shall be in the range[first,last)
. -
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator>
OutputIterator
merge(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator, class Compare>
OutputIterator
merge(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result, Compare comp);
-
Effects: Copies all the elements of the two ranges
[first1,last1)
and[first2,last2)
into the range[result,result_last)
, whereresult_last
isresult + (last1 - first1) + (last2 - first2)
, such that the resulting range satisfiesis_sorted(result, result_last)
oris_sorted(result, result_last, comp)
, respectively. The algorithm's execution is parallelized as determined byexec
. -
Requires: The ranges
[first1,last1)
and[first2,last2)
shall be sorted with respect tooperator<
orcomp
. The resulting range shall not overlap with either of the input ranges. -
Returns:
result + (last1 - first1) + (last2 - first2)
. -
Complexity:
O(m + n)
, wherem = last1 - first1
andn = last2 - first2
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class BidirectionalIterator>
void inplace_merge(ExecutionPolicy &&exec,
BidirectionalIterator first,
BidirectionalIterator middle,
BidirectionalIterator last);
template<class ExecutionPolicy,
class BidirectionalIterator,
class Compare>
void inplace_merge(ExecutionPolicy &&exec,
BidirectionalIterator first,
BidirectionalIterator middle,
BidirectionalIterator last, Compare comp);
-
Effects: Merges two sorted consecutive ranges
[first,middle)
and[middle,last)
, putting the result of the merge into the range[first,last)
. The resulting range will be in non-decreasing order; that is, for every iteratori
in[first,last)
other thanfirst
, the condition*i < *(i - 1)
or, respectively,comp(*i, *(i - 1))
will befalse
. The algorithm's execution is parallelized as determined byexec
. -
Requires: The ranges
[first,middle)
and[middle,last)
shall be sorted with respect tooperator<
orcomp
.BidirectionalIterator
shall satisfy the requirements ofValueSwappable
. The type of*first
shall satisfy the requirementsofMoveConstructible
and ofMoveAssignable
. -
Remarks: Stable.
-
Complexity:
O(m + n)
, wherem = middle - first
andn = last - middle
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2>
bool includes(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class Compare>
bool includes(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
Compare comp);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Requires: The ranges
[first1,last1)
and[first2,last2)
shall be sorted with respect tooperator<
orcomp
. -
Returns:
true
if[first2,last2)
is empty or if every element in the range[first2,last2)
is contained in the range[first1,last1)
. Returnsfalse
otherwise. -
Complexity:
O(m + n)
, wherem = last1 - first1
andn = last2 - first2
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator>
OutputIterator
set_union(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator, class Compare>
OutputIterator
set_union(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result, Compare comp);
-
Effects: Constructs a sorted union of the elements from the two ranges; that is, the set of elements that are present in one or both of the ranges. The algorithm's execution is parallelized as determined by
exec
. -
Requires: The resulting range shall not overlap with either of the original ranges.
-
Returns: The end of the constructed range.
-
Complexity:
O(m + n)
, wherem = last1 - first1
andn = last2 - first2
. -
Remarks: If
[first1,last1)
contains$m$ elements that are equivalent to each other and[first2,last2)
contains$n$ elements that are equivalent to them, then all$m$ elements from the first range shall be copied to the output range, in order, and then$max(n - m,0)$ elements from the second range shall be copied to the output range, in order.The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator>
OutputIterator
set_intersection(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator, class Compare>
OutputIterator
set_intersection(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result, Compare comp);
-
Effects: Constructs a sorted intersection of the elements from the two ranges; that is, the set of elements that are present in both of the ranges. The algorithm's execution is parallelized as determined by
exec
. -
Requires: The resulting range shall not overlap with either of the original ranges.
-
Returns: The end of the constructed range.
-
Complexity:
O(m + n)
, wherem = last1 - first1
andn = last2 - first2
. -
Remarks: If
[first1,last1)
contains$m$ elements that are equivalent to each other and[first2,last2)
contains$n$ elements that are equivalent to them, the first$min(m,n)$ elements shall be copied from the first range to the output range, in order.The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator>
OutputIterator
set_difference(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator, class Compare>
OutputIterator
set_difference(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result, Compare comp);
-
Effects: Copies the elements of the range
[first1,last1)
which are not present in the range[first2,last2)
to the range beginning atresult
. The elements in the constructed range are sorted. The algorithm's execution is parallelized as determined byexec
. -
Requires: The resulting range shall not overlap with either of the original ranges.
-
Returns: The end of the constructed range.
-
Complexity:
O(m + n)
, wherem = last1 - first1
andn = last2 - first2
. -
Remarks: If
[first1,last1)
contains$m$ elements that are equivalent to each other and[first2,last2)
contains$n$ elements that are equivalent to them, the last$max(m-n,0)$ elements from[first1,last1)
shall be copied to the output range.The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator>
OutputIterator
set_symmetric_difference(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2,
class OutputIterator, class Compare>
OutputIterator
set_symmetric_difference(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator result, Compare comp);
-
Effects: Copies the elements of the range
[first1,last1)
that are not present in the range[first2,last2)
, and the elements of the range[first2,last2)
that are not present in the range[first1,last1)
to the range beginning atresult
. The elements in the constructed range are sorted. The algorithm's execution is parallelized as determined byexec
. -
Requires: The resulting range shall not overlap with either of the original ranges.
-
Returns: The end of the constructed range.
-
Complexity:
O(m + n)
, wherem = last1 - first1
andn = last2 - first2
. -
Remarks: If
[first1,last1)
contains$m$ elements that are equivalent to each other and[first2,last2)
contains$n$ elements that are equivalent to them, then$|m-n|$ of those elements shall be copied to the output range: the last$m - n$ of these elements from[first1,last1)
if$m > n$ , and the last$n - m$ of these elements from[first2,last2)
if$m < n$ .The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator min_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, class Compare>
ForwardIterator min_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
Compare comp);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: The first iterator
i
in the range[first,last)
such that for any iteratorj
in the range[first,last)
the following corresponding conditions hold:!(*j < *i)
orcomp(*j, *i) == false
. Returnslast
iffirst == last
. -
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator>
ForwardIterator max_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, class Compare>
ForwardIterator max_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last,
Compare comp);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: The first iterator
i
in the range[first,last)
such that for any iteratorj
in the range[first,last)
the following corresponding conditions hold:!(*i < *j)
orcomp(*i, *j) == false
. Returnslast
iffirst == last
. -
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class ForwardIterator>
pair<ForwardIterator, ForwardIterator>
minmax_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy,
class ForwardIterator, class Compare>
pair<ForwardIterator, ForwardIterator>
minmax_element(ExecutionPolicy &&exec,
ForwardIterator first, ForwardIterator last, Compare comp);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns:
make_pair(first, first)
if[first,last)
is empty, otherwisemake_pair(m, M)
, wherem
is the first iterator in[first,last)
such that no iterator in the range refers to a smaller element, and whereM
is the last iterator in[first,last)
such that no iterator in the range refers to a larger element. -
Complexity:
O(last - first)
. -
Remarks: The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2>
bool
lexicographical_compare(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class Compare>
bool
lexicographical_compare(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
Compare comp);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns:
true
if the sequence of elements defined by the range[first1,last1)
is lexicographically less than the sequence of elements defined by the range[first2,last2)
andfalse
otherwise. -
Complexity:
O(min(m,n))
, wherem = last1 - first1
andn = last2 - first2
. -
Remarks: If two sequences have the same number of elements and their corresponding elements are equivalent, then neither sequence is lexicographically less than the other. If one sequence is a prefix of the other, then the shorter sequence is lexicographically less than the longer sequence. Otherwise, the lexicographical comparison of the sequences yields the same result as the comparison of the first corresponding pair of elements that are not equivalent.
An empty sequence is lexicographically less than any non-empty sequence, but not less than any empty sequence.
The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
namespace std {
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class T>
T inner_product(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init);
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class T,
class BinaryOperation1, class BinaryOperation2>
T inner_product(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init,
BinaryOperation1 binary_op1,
BinaryOperation2 binary_op2);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator>
OutputIterator adjacent_difference(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class BinaryOperation>
OutputIterator adjacent_difference(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result,
BinaryOperation binary_op);
}
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class T>
T inner_product(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: The result of the sum
init + (*(first1 + i) * *(first2 + i) + ...
for every integeri
in the range[0, (last1 - first1))
.The order of operands of the sum is unspecified.
-
Requires:
operator+
shall have associativity and commutativity.operator+
shall not invalidate iterators or subranges, nor modify elements in the ranges[first1,last1)
or[first2,first2 + (last1 - first1))
. -
Complexity:
O(last1 - first1)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator1, class InputIterator2, class T,
class BinaryOperation1, class BinaryOperation2>
T inner_product(ExecutionPolicy &&exec,
InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init,
BinaryOperation1 binary_op1,
BinaryOperation2 binary_op2);
-
Effects: The algorithm's execution is parallelized as determined by
exec
. -
Returns: The result of the generalized sum whose operands are
init
and the result of the pairwise binary operationbinary_op2(*i,*(first2 + (i - first1)))
for all iteratorsi
in the range[first1,last1)
.The generalized sum's operands are combined via application of the pairwise binary operation
binary_op1
.The order of operands of the sum is unspecified.
-
Requires:
binary_op1
shall have associativity and commutativity.binary_op1
andbinary_op2
shall neither invalidate iterators or subranges, nor modify elements in the ranges[first1,last1)
or[first2,first2 + (last1 - first1))
. -
Complexity:
O(last1 - first1)
. -
Remarks: The signature shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.
template<class ExecutionPolicy,
class InputIterator, class OutputIterator>
OutputIterator adjacent_difference(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result);
template<class ExecutionPolicy,
class InputIterator, class OutputIterator, class BinaryOperation>
OutputIterator adjacent_difference(ExecutionPolicy &&exec,
InputIterator first, InputIterator last,
OutputIterator result,
BinaryOperation binary_op);
-
Effects: Performs
*result = *first
and for each iteratori
in the range[first + 1, last)
, performs*result = *i - *(i - 1)
, or*result = binary_op(*i, *(i - 1))
, respectively.The algorithm's execution is parallelized as determined by
exec
. -
Returns:
result + (last - first)
. -
Requires: The result of the expression
*i - *(i - 1)
orbinary_op(*i, *(i - 1))
shall be writable to theresult
output iterator.Neither
operator-
norbinary_op
shall invalidate iterators or subranges, nor modify elements in the range[first,last)
or[result,result + (last - first))
. -
Complexity:
O(last - first)
. -
Remarks:
result
may be equal tofirst
.The signatures shall not participate in overload resolution if
is_execution_policy<ExecutionPolicy>::value
isfalse
.