ADC Home > Reference Library > Reference > Darwin > Miscellaneous User Space API Reference
|
stl_algo.h |
Includes: |
This is an internal header file, included by other library headers. You should not attempt to use it directly.
__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) |
template<typename _RandomAccessIterator> void __final_insertion_sort( _RandomAccessIterator __first, _RandomAccessIterator __last)
@if maint This is a helper function for the sort routine. @endif
__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) |
template<typename _RandomAccessIterator, typename _Compare> void __final_insertion_sort( _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
@if maint This is a helper function for the sort routine. @endif
__gcd |
template<typename _EuclideanRingElement> _EuclideanRingElement __gcd( _EuclideanRingElement __m, _EuclideanRingElement __n)
@if maint This is a helper function for the rotate algorithm specialized on RAIs. It returns the greatest common divisor of two integer values. @endif
__inplace_stable_partition |
template<typename _ForwardIterator, typename _Predicate, typename _Distance> _ForwardIterator __inplace_stable_partition( _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, _Distance __len)
@if maint This is a helper function... @endif
__inplace_stable_sort(_RandomAccessIterator, _RandomAccessIterator) |
template<typename _RandomAccessIterator> void __inplace_stable_sort( _RandomAccessIterator __first, _RandomAccessIterator __last)
@if maint This is a helper function for the stable sorting routines. @endif
__inplace_stable_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) |
template<typename _RandomAccessIterator, typename _Compare> void __inplace_stable_sort( _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
@if maint This is a helper function for the stable sorting routines. @endif
__insertion_sort(_RandomAccessIterator, _RandomAccessIterator) |
template<typename _RandomAccessIterator> void __insertion_sort( _RandomAccessIterator __first, _RandomAccessIterator __last)
@if maint This is a helper function for the sort routine. @endif
__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) |
template<typename _RandomAccessIterator, typename _Compare> void __insertion_sort( _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
@if maint This is a helper function for the sort routine. @endif
__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) |
template<typename _RandomAccessIterator, typename _Size> void __introsort_loop( _RandomAccessIterator __first, _RandomAccessIterator __last, _Size __depth_limit)
@if maint This is a helper function for the sort routine. @endif
__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) |
template<typename _RandomAccessIterator, typename _Size, typename _Compare> void __introsort_loop( _RandomAccessIterator __first, _RandomAccessIterator __last, _Size __depth_limit, _Compare __comp)
@if maint This is a helper function for the sort routine. @endif
__lg |
template<typename _Size> inline _Size __lg( _Size __n)
@if maint This is a helper function for the sort routine. @endif
__median(const _Tp &, const _Tp &, const _Tp &) |
template<typename _Tp> inline const _Tp& __median( const _Tp& __a, const _Tp& __b, const _Tp& __c)
a
b
c
One of @p a, @p b or @p c.
If @c {l,m,n} is some convolution of @p {a,b,c} such that @c l<=m<=n
then the value returned will be @c m.
This is an SGI extension.
@ingroup SGIextensions
@brief Find the median of three values.
__median(const _Tp &, const _Tp &, const _Tp &, _Compare) |
template<typename _Tp, typename _Compare> inline const _Tp& __median( const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp)
a
b
c
comp
One of @p a, @p b or @p c.
If @c {l,m,n} is some convolution of @p {a,b,c} such that @p comp(l,m)
and @p comp(m,n) are both true then the value returned will be @c m.
This is an SGI extension.
@ingroup SGIextensions
@brief Find the median of three values using a predicate for comparison.
__merge_adaptive(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator, _Distance, _Distance, _Pointer, _Distance) |
template<typename _BidirectionalIterator, typename _Distance, typename _Pointer> void __merge_adaptive( _BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, _Distance __len1, _Distance __len2, _Pointer __buffer, _Distance __buffer_size)
@if maint This is a helper function for the merge routines. @endif
__merge_adaptive(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator, _Distance, _Distance, _Pointer, _Distance, _Compare) |
template<typename _BidirectionalIterator, typename _Distance, typename _Pointer, typename _Compare> void __merge_adaptive( _BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, _Distance __len1, _Distance __len2, _Pointer __buffer, _Distance __buffer_size, _Compare __comp)
@if maint This is a helper function for the merge routines. @endif
__merge_backward(_BidirectionalIterator1, _BidirectionalIterator1, _BidirectionalIterator2, _BidirectionalIterator2, _BidirectionalIterator3) |
template<typename _BidirectionalIterator1, typename _BidirectionalIterator2, typename _BidirectionalIterator3> _BidirectionalIterator3 __merge_backward( _BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1, _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, _BidirectionalIterator3 __result)
@if maint This is a helper function for the merge routines. @endif
__merge_backward(_BidirectionalIterator1, _BidirectionalIterator1, _BidirectionalIterator2, _BidirectionalIterator2, _BidirectionalIterator3, _Compare) |
template<typename _BidirectionalIterator1, typename _BidirectionalIterator2, typename _BidirectionalIterator3, typename _Compare> _BidirectionalIterator3 __merge_backward( _BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1, _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, _BidirectionalIterator3 __result, _Compare __comp)
@if maint This is a helper function for the merge routines. @endif
__merge_without_buffer(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator, _Distance, _Distance) |
template<typename _BidirectionalIterator, typename _Distance> void __merge_without_buffer( _BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, _Distance __len1, _Distance __len2)
@if maint This is a helper function for the merge routines. @endif
__merge_without_buffer(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator, _Distance, _Distance, _Compare) |
template<typename _BidirectionalIterator, typename _Distance, typename _Compare> void __merge_without_buffer( _BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, _Distance __len1, _Distance __len2, _Compare __comp)
@if maint This is a helper function for the merge routines. @endif
__partition(_BidirectionalIterator, _BidirectionalIterator, _Predicate, bidirectional_iterator_tag) |
template<typename _BidirectionalIterator, typename _Predicate> _BidirectionalIterator __partition( _BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, bidirectional_iterator_tag)
@if maint This is a helper function... @endif
__partition(_ForwardIterator, _ForwardIterator, _Predicate, forward_iterator_tag) |
template<typename _ForwardIterator, typename _Predicate> _ForwardIterator __partition( _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag)
@if maint This is a helper function... @endif
__reverse(_BidirectionalIterator, _BidirectionalIterator, bidirectional_iterator_tag) |
template<typename _BidirectionalIterator> void __reverse( _BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag)
@if maint This is an uglified reverse(_BidirectionalIterator, _BidirectionalIterator) overloaded for bidirectional iterators. @endif
__reverse(_RandomAccessIterator, _RandomAccessIterator, random_access_iterator_tag) |
template<typename _RandomAccessIterator> void __reverse( _RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag)
@if maint This is an uglified reverse(_BidirectionalIterator, _BidirectionalIterator) overloaded for random access iterators. @endif
__rotate |
template<typename _RandomAccessIterator> void __rotate( _RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, random_access_iterator_tag)
@if maint This is a helper function for the rotate algorithm. @endif
__rotate(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator, bidirectional_iterator_tag) |
template<typename _BidirectionalIterator> void __rotate( _BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, bidirectional_iterator_tag)
@if maint This is a helper function for the rotate algorithm. @endif
__rotate(_ForwardIterator, _ForwardIterator, _ForwardIterator, forward_iterator_tag) |
template<typename _ForwardIterator> void __rotate( _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, forward_iterator_tag)
@if maint This is a helper function for the rotate algorithm. @endif
__rotate_adaptive |
template<typename _BidirectionalIterator1, typename _BidirectionalIterator2, typename _Distance> _BidirectionalIterator1 __rotate_adaptive( _BidirectionalIterator1 __first, _BidirectionalIterator1 __middle, _BidirectionalIterator1 __last, _Distance __len1, _Distance __len2, _BidirectionalIterator2 __buffer, _Distance __buffer_size)
@if maint This is a helper function for the merge routines. @endif
__stable_partition_adaptive |
template<typename _ForwardIterator, typename _Pointer, typename _Predicate, typename _Distance> _ForwardIterator __stable_partition_adaptive( _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, _Distance __len, _Pointer __buffer, _Distance __buffer_size)
@if maint This is a helper function... @endif
__unguarded_linear_insert(_RandomAccessIterator, _Tp) |
template<typename _RandomAccessIterator, typename _Tp> void __unguarded_linear_insert( _RandomAccessIterator __last, _Tp __val)
@if maint This is a helper function for the sort routine. @endif
__unguarded_linear_insert(_RandomAccessIterator, _Tp, _Compare) |
template<typename _RandomAccessIterator, typename _Tp, typename _Compare> void __unguarded_linear_insert( _RandomAccessIterator __last, _Tp __val, _Compare __comp)
@if maint This is a helper function for the sort routine. @endif
__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, _Tp) |
template<typename _RandomAccessIterator, typename _Tp> _RandomAccessIterator __unguarded_partition( _RandomAccessIterator __first, _RandomAccessIterator __last, _Tp __pivot)
@if maint This is a helper function... @endif
__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, _Tp, _Compare) |
template<typename _RandomAccessIterator, typename _Tp, typename _Compare> _RandomAccessIterator __unguarded_partition( _RandomAccessIterator __first, _RandomAccessIterator __last, _Tp __pivot, _Compare __comp)
@if maint This is a helper function... @endif
__unique_copy(_InputIterator, _InputIterator, _ForwardIterator, forward_iterator_tag) |
template<typename _InputIterator, typename _ForwardIterator> _ForwardIterator __unique_copy( _InputIterator __first, _InputIterator __last, _ForwardIterator __result, forward_iterator_tag)
@if maint This is an uglified unique_copy(_InputIterator, _InputIterator, _OutputIterator) overloaded for forward iterators. @endif
__unique_copy(_InputIterator, _InputIterator, _ForwardIterator, _BinaryPredicate, forward_iterator_tag) |
template<typename _InputIterator, typename _ForwardIterator, typename _BinaryPredicate> _ForwardIterator __unique_copy( _InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __binary_pred, forward_iterator_tag)
@if maint This is an uglified unique_copy(_InputIterator, _InputIterator, _OutputIterator, _BinaryPredicate) overloaded for forward iterators. @endif
__unique_copy(_InputIterator, _InputIterator, _OutputIterator, output_iterator_tag) |
template<typename _InputIterator, typename _OutputIterator> _OutputIterator __unique_copy( _InputIterator __first, _InputIterator __last, _OutputIterator __result, output_iterator_tag)
@if maint This is an uglified unique_copy(_InputIterator, _InputIterator, _OutputIterator) overloaded for output iterators. @endif
__unique_copy(_InputIterator, _InputIterator, _OutputIterator, _BinaryPredicate, output_iterator_tag) |
template<typename _InputIterator, typename _OutputIterator, typename _BinaryPredicate> _OutputIterator __unique_copy( _InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __binary_pred, output_iterator_tag)
@if maint This is an uglified unique_copy(_InputIterator, _InputIterator, _OutputIterator, _BinaryPredicate) overloaded for output iterators. @endif
adjacent_find(_ForwardIterator, _ForwardIterator) |
template<typename _ForwardIterator> _ForwardIterator adjacent_find( _ForwardIterator __first, _ForwardIterator __last)
first
last
The first iterator @c i such that @c i and @c i+1 are both valid iterators in @p [first,last) and such that @c *i == @c *(i+1), or @p last if no such iterator exists.
@brief Find two adjacent values in a sequence that are equal.
adjacent_find(_ForwardIterator, _ForwardIterator, _BinaryPredicate) |
template<typename _ForwardIterator, typename _BinaryPredicate> _ForwardIterator adjacent_find( _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __binary_pred)
first
last
binary_pred
The first iterator @c i such that @c i and @c i+1 are both valid iterators in @p [first,last) and such that @p binary_pred(*i,*(i+1)) is true, or @p last if no such iterator exists.
@brief Find two adjacent values in a sequence using a predicate.
binary_search(_ForwardIterator, _ForwardIterator, const _Tp &) |
template<typename _ForwardIterator, typename _Tp> bool binary_search( _ForwardIterator __first, _ForwardIterator __last, const _Tp& __val)
first
last
val
True if @a val (or its equivelent) is in [@a first,@a last ].
@ingroup binarysearch
Note that this does not actually return an iterator to @a val. For
that, use std::find or a container's specialized find member functions.
@brief Determines whether an element exists in a range.
binary_search(_ForwardIterator, _ForwardIterator, const _Tp &, _Compare) |
template<typename _ForwardIterator, typename _Tp, typename _Compare> bool binary_search( _ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp)
first
last
val
comp
True if @a val (or its equivelent) is in [@a first,@a last ].
@ingroup binarysearch
Note that this does not actually return an iterator to @a val. For
that, use std::find or a container's specialized find member functions.
The comparison function should have the same effects on ordering as
the function used for the initial sort.
@brief Determines whether an element exists in a range.
count |
template<typename _InputIterator, typename _Tp> typename iterator_traits<_InputIterator>::difference_type count( _InputIterator __first, _InputIterator __last, const _Tp& __value)
first
last
value
The number of iterators @c i in the range @p [first,last) for which @c *i == @p value
@brief Count the number of copies of a value in a sequence.
count_if |
template<typename _InputIterator, typename _Predicate> typename iterator_traits<_InputIterator>::difference_type count_if( _InputIterator __first, _InputIterator __last, _Predicate __pred)
first
last
pred
The number of iterators @c i in the range @p [first,last) for which @p pred(*i) is true.
@brief Count the elements of a sequence for which a predicate is true.
equal_range(_ForwardIterator, _ForwardIterator, const _Tp &) |
template<typename _ForwardIterator, typename _Tp> pair<_ForwardIterator, _ForwardIterator> equal_range( _ForwardIterator __first, _ForwardIterator __last, const _Tp& __val)
first
last
val
An pair of iterators defining the subrange.
@ingroup binarysearch
This is equivalent to
@code
std::make_pair(lower_bound(first, last, val),
upper_bound(first, last, val))
@endcode
but does not actually call those functions.
@brief Finds the largest subrange in which @a val could be inserted at any place in it without changing the ordering.
equal_range(_ForwardIterator, _ForwardIterator, const _Tp &, _Compare) |
template<typename _ForwardIterator, typename _Tp, typename _Compare> pair<_ForwardIterator, _ForwardIterator> equal_range( _ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp)
first
last
val
comp
An pair of iterators defining the subrange.
@ingroup binarysearch
This is equivalent to
@code
std::make_pair(lower_bound(first, last, val, comp),
upper_bound(first, last, val, comp))
@endcode
but does not actually call those functions.
@brief Finds the largest subrange in which @a val could be inserted at any place in it without changing the ordering.
find |
template<typename _InputIterator, typename _Tp> inline _InputIterator find( _InputIterator __first, _InputIterator __last, const _Tp& __val)
first
last
val
The first iterator @c i in the range @p [first,last) such that @c *i == @p val, or @p last if no such iterator exists.
@brief Find the first occurrence of a value in a sequence.
find(_InputIterator, _InputIterator, const _Tp &, input_iterator_tag) |
template<typename _InputIterator, typename _Tp> inline _InputIterator find( _InputIterator __first, _InputIterator __last, const _Tp& __val, input_iterator_tag)
@if maint This is an overload used by find() for the Input Iterator case. @endif
find(_RandomAccessIterator, _RandomAccessIterator, const _Tp &, random_access_iterator_tag) |
template<typename _RandomAccessIterator, typename _Tp> _RandomAccessIterator find( _RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __val, random_access_iterator_tag)
@if maint This is an overload used by find() for the RAI case. @endif
find_end(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2) |
template<typename _ForwardIterator1, typename _ForwardIterator2> inline _ForwardIterator1 find_end( _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2)
first1
last1
first2
last2
The last iterator @c i in the range
@p [first1,last1-(last2-first2)) such that @c *(i+N) == @p *(first2+N)
for each @c N in the range @p [0,last2-first2), or @p last1 if no
such iterator exists.
Searches the range @p [first1,last1) for a sub-sequence that compares
equal value-by-value with the sequence given by @p [first2,last2) and
returns an iterator to the first element of the sub-sequence, or
@p last1 if the sub-sequence is not found. The sub-sequence will be the
last such subsequence contained in [first,last1).
Because the sub-sequence must lie completely within the range
@p [first1,last1) it must start at a position less than
@p last1-(last2-first2) where @p last2-first2 is the length of the
sub-sequence.
This means that the returned iterator @c i will be in the range
@p [first1,last1-(last2-first2))
@brief Find last matching subsequence in a sequence.
find_end(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _BinaryPredicate) |
template<typename _ForwardIterator1, typename _ForwardIterator2, typename _BinaryPredicate> inline _ForwardIterator1 find_end( _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __comp)
first1
last1
first2
last2
comp
The last iterator @c i in the range
@p [first1,last1-(last2-first2)) such that @c predicate(*(i+N), @p
(first2+N)) is true for each @c N in the range @p [0,last2-first2), or
@p last1 if no such iterator exists.
Searches the range @p [first1,last1) for a sub-sequence that compares
equal value-by-value with the sequence given by @p [first2,last2) using
comp as a predicate and returns an iterator to the first element of the
sub-sequence, or @p last1 if the sub-sequence is not found. The
sub-sequence will be the last such subsequence contained in
[first,last1).
Because the sub-sequence must lie completely within the range
@p [first1,last1) it must start at a position less than
@p last1-(last2-first2) where @p last2-first2 is the length of the
sub-sequence.
This means that the returned iterator @c i will be in the range
@p [first1,last1-(last2-first2))
@brief Find last matching subsequence in a sequence using a predicate.
find_first_of(_InputIterator, _InputIterator, _ForwardIterator, _ForwardIterator) |
template<typename _InputIterator, typename _ForwardIterator> _InputIterator find_first_of( _InputIterator __first1, _InputIterator __last1, _ForwardIterator __first2, _ForwardIterator __last2)
first1
last1
first2
last2
The first iterator @c i in the range
@p [first1,last1) such that @c *i == @p *(i2) such that i2 is an
interator in [first2,last2), or @p last1 if no such iterator exists.
Searches the range @p [first1,last1) for an element that is equal to
some element in the range [first2,last2). If found, returns an iterator
in the range [first1,last1), otherwise returns @p last1.
@brief Find element from a set in a sequence.
find_first_of(_InputIterator, _InputIterator, _ForwardIterator, _ForwardIterator, _BinaryPredicate) |
template<typename _InputIterator, typename _ForwardIterator, typename _BinaryPredicate> _InputIterator find_first_of( _InputIterator __first1, _InputIterator __last1, _ForwardIterator __first2, _ForwardIterator __last2, _BinaryPredicate __comp)
first1
last1
first2
last2
comp
The first iterator @c i in the range
@p [first1,last1) such that @c comp(*i, @p *(i2)) is true and i2 is an
interator in [first2,last2), or @p last1 if no such iterator exists.
Searches the range @p [first1,last1) for an element that is equal to
some element in the range [first2,last2). If found, returns an iterator in
the range [first1,last1), otherwise returns @p last1.
@brief Find element from a set in a sequence using a predicate.
find_if |
template<typename _InputIterator, typename _Predicate> inline _InputIterator find_if( _InputIterator __first, _InputIterator __last, _Predicate __pred)
first
last
pred
The first iterator @c i in the range @p [first,last) such that @p pred(*i) is true, or @p last if no such iterator exists.
@brief Find the first element in a sequence for which a predicate is true.
find_if(_InputIterator, _InputIterator, _Predicate, input_iterator_tag) |
template<typename _InputIterator, typename _Predicate> inline _InputIterator find_if( _InputIterator __first, _InputIterator __last, _Predicate __pred, input_iterator_tag)
@if maint This is an overload used by find_if() for the Input Iterator case. @endif
find_if(_RandomAccessIterator, _RandomAccessIterator, _Predicate, random_access_iterator_tag) |
template<typename _RandomAccessIterator, typename _Predicate> _RandomAccessIterator find_if( _RandomAccessIterator __first, _RandomAccessIterator __last, _Predicate __pred, random_access_iterator_tag)
@if maint This is an overload used by find_if() for the RAI case. @endif
for_each |
template<typename _InputIterator, typename _Function> _Function for_each( _InputIterator __first, _InputIterator __last, _Function __f)
first
last
f
@p f.
Applies the function object @p f to each element in the range
@p [first,last). @p f must not modify the order of the sequence.
If @p f has a return value it is ignored.
@brief Apply a function to every element of a sequence.
generate |
template<typename _ForwardIterator, typename _Generator> void generate( _ForwardIterator __first, _ForwardIterator __last, _Generator __gen)
first
last
gen
generate() returns no value.
Performs the assignment @c *i = @p gen() for each @c i in the range
@p [first,last).
@brief Assign the result of a function object to each value in a sequence.
generate_n |
template<typename _OutputIterator, typename _Size, typename _Generator> _OutputIterator generate_n( _OutputIterator __first, _Size __n, _Generator __gen)
first
n
gen
The end of the sequence, @p first+n
Performs the assignment @c *i = @p gen() for each @c i in the range
@p [first,first+n).
@brief Assign the result of a function object to each value in a sequence.
includes(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2) |
template<typename _InputIterator1, typename _InputIterator2> bool includes( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2)
first1
last1
first2
last2
True if each element in [first2,last2) is contained in order
within [first1,last1). False otherwise.
@ingroup setoperations
This operation expects both [first1,last1) and [first2,last2) to be
sorted. Searches for the presence of each element in [first2,last2)
within [first1,last1). The iterators over each range only move forward,
so this is a linear algorithm. If an element in [first2,last2) is not
found before the search iterator reaches @a last2, false is returned.
@brief Determines whether all elements of a sequence exists in a range.
includes(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _Compare) |
template<typename _InputIterator1, typename _InputIterator2, typename _Compare> bool includes( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
first1
last1
first2
last2
comp
True if each element in [first2,last2) is contained in order
within [first1,last1) according to comp. False otherwise.
@ingroup setoperations
This operation expects both [first1,last1) and [first2,last2) to be
sorted. Searches for the presence of each element in [first2,last2)
within [first1,last1), using comp to decide. The iterators over each
range only move forward, so this is a linear algorithm. If an element
in [first2,last2) is not found before the search iterator reaches @a
last2, false is returned.
@brief Determines whether all elements of a sequence exists in a range using comparison.
lower_bound(_ForwardIterator, _ForwardIterator, const _Tp &) |
template<typename _ForwardIterator, typename _Tp> _ForwardIterator lower_bound( _ForwardIterator __first, _ForwardIterator __last, const _Tp& __val)
first
last
val
An iterator pointing to the first element "not less than" @a val, or end() if every element is less than @a val. @ingroup binarysearch
@brief Finds the first position in which @a val could be inserted without changing the ordering.
lower_bound(_ForwardIterator, _ForwardIterator, const _Tp &, _Compare) |
template<typename _ForwardIterator, typename _Tp, typename _Compare> _ForwardIterator lower_bound( _ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp)
first
last
val
comp
An iterator pointing to the first element "not less than" @a val,
or end() if every element is less than @a val.
@ingroup binarysearch
The comparison function should have the same effects on ordering as
the function used for the initial sort.
@brief Finds the first position in which @a val could be inserted without changing the ordering.
max_element(_ForwardIterator, _ForwardIterator) |
template<typename _ForwardIterator> _ForwardIterator max_element( _ForwardIterator __first, _ForwardIterator __last)
first
last
Iterator referencing the first instance of the largest value.
@brief Return the maximum element in a range.
max_element(_ForwardIterator, _ForwardIterator, _Compare) |
template<typename _ForwardIterator, typename _Compare> _ForwardIterator max_element( _ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
first
last
comp
Iterator referencing the first instance of the largest value according to comp.
@brief Return the maximum element in a range using comparison functor.
merge(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator) |
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator> _OutputIterator merge( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
first1
first2
last1
last2
result
An iterator pointing to the first element "not less than" @a val.
Merges the ranges [first1,last1) and [first2,last2) into the sorted range
[result, result + (last1-first1) + (last2-first2)). Both input ranges
must be sorted, and the output range must not overlap with either of
the input ranges. The sort is @e stable, that is, for equivalent
elements in the two ranges, elements from the first range will always
come before elements from the second.
@brief Merges two sorted ranges.
merge(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator, _Compare) |
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator, typename _Compare> _OutputIterator merge( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
first1
first2
last1
last2
result
comp
An iterator pointing to the first element "not less than" @a val.
Merges the ranges [first1,last1) and [first2,last2) into the sorted range
[result, result + (last1-first1) + (last2-first2)). Both input ranges
must be sorted, and the output range must not overlap with either of
the input ranges. The sort is @e stable, that is, for equivalent
elements in the two ranges, elements from the first range will always
come before elements from the second.
The comparison function should have the same effects on ordering as
the function used for the initial sort.
@brief Merges two sorted ranges.
min_element(_ForwardIterator, _ForwardIterator) |
template<typename _ForwardIterator> _ForwardIterator min_element( _ForwardIterator __first, _ForwardIterator __last)
first
last
Iterator referencing the first instance of the smallest value.
@brief Return the minimum element in a range.
min_element(_ForwardIterator, _ForwardIterator, _Compare) |
template<typename _ForwardIterator, typename _Compare> _ForwardIterator min_element( _ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
first
last
comp
Iterator referencing the first instance of the smallest value according to comp.
@brief Return the minimum element in a range using comparison functor.
next_permutation(_BidirectionalIterator, _BidirectionalIterator) |
template<typename _BidirectionalIterator> bool next_permutation( _BidirectionalIterator __first, _BidirectionalIterator __last)
first
last
False if wrapped to first permutation, true otherwise.
Treats all permutations of the range as a set of "dictionary" sorted
sequences. Permutes the current sequence into the next one of this set.
Returns true if there are more sequences to generate. If the sequence
is the largest of the set, the smallest is generated and false returned.
@brief Permute range into the next "dictionary" ordering.
next_permutation(_BidirectionalIterator, _BidirectionalIterator, _Compare) |
template<typename _BidirectionalIterator, typename _Compare> bool next_permutation( _BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
first
last
comp
False if wrapped to first permutation, true otherwise.
Treats all permutations of the range [first,last) as a set of
"dictionary" sorted sequences ordered by @a comp. Permutes the current
sequence into the next one of this set. Returns true if there are more
sequences to generate. If the sequence is the largest of the set, the
smallest is generated and false returned.
@brief Permute range into the next "dictionary" ordering using comparison functor.
nth_element(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) |
template<typename _RandomAccessIterator> void nth_element( _RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last)
first
nth
last
Nothing.
Rearranges the elements in the range @p [first,last) so that @p *nth
is the same element that would have been in that position had the
whole sequence been sorted.
whole sequence been sorted. The elements either side of @p *nth are
not completely sorted, but for any iterator @i in the range
@p [first,nth) and any iterator @j in the range @p [nth,last) it
holds that @p *j<*i is false.
@brief Sort a sequence just enough to find a particular position.
nth_element(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) |
template<typename _RandomAccessIterator, typename _Compare> void nth_element( _RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)
first
nth
last
comp
Nothing.
Rearranges the elements in the range @p [first,last) so that @p *nth
is the same element that would have been in that position had the
whole sequence been sorted. The elements either side of @p *nth are
not completely sorted, but for any iterator @i in the range
@p [first,nth) and any iterator @j in the range @p [nth,last) it
holds that @p comp(*j,*i) is false.
@brief Sort a sequence just enough to find a particular position using a predicate for comparison.
partial_sort_copy(_InputIterator, _InputIterator, _RandomAccessIterator, _RandomAccessIterator) |
template<typename _InputIterator, typename _RandomAccessIterator> _RandomAccessIterator partial_sort_copy( _InputIterator __first, _InputIterator __last, _RandomAccessIterator __result_first, _RandomAccessIterator __result_last)
first
last
result_first
result_last
An iterator indicating the end of the resulting sequence.
Copies and sorts the smallest N values from the range @p [first,last)
to the range beginning at @p result_first, where the number of
elements to be copied, @p N, is the smaller of @p (last-first) and
@p (result_last-result_first).
After the sort if @p i and @j are iterators in the range
@p [result_first,result_first+N) such that @i precedes @j then
@p *j<*i is false.
The value returned is @p result_first+N.
@brief Copy the smallest elements of a sequence.
partial_sort_copy(_InputIterator, _InputIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) |
template<typename _InputIterator, typename _RandomAccessIterator, typename _Compare> _RandomAccessIterator partial_sort_copy( _InputIterator __first, _InputIterator __last, _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp)
first
last
result_first
result_last
comp
An iterator indicating the end of the resulting sequence.
Copies and sorts the smallest N values from the range @p [first,last)
to the range beginning at @p result_first, where the number of
elements to be copied, @p N, is the smaller of @p (last-first) and
@p (result_last-result_first).
After the sort if @p i and @j are iterators in the range
@p [result_first,result_first+N) such that @i precedes @j then
@p comp(*j,*i) is false.
The value returned is @p result_first+N.
@brief Copy the smallest elements of a sequence using a predicate for comparison.
partition |
template<typename _ForwardIterator, typename _Predicate> inline _ForwardIterator partition( _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
first
last
pred
An iterator @p middle such that @p pred(i) is true for each
iterator @p i in the range @p [first,middle) and false for each @p i
in the range @p [middle,last).
@p pred must not modify its operand. @p partition() does not preserve
the relative ordering of elements in each group, use
@p stable_partition() if this is needed.
@brief Move elements for which a predicate is true to the beginning of a sequence.
prev_permutation(_BidirectionalIterator, _BidirectionalIterator) |
template<typename _BidirectionalIterator> bool prev_permutation( _BidirectionalIterator __first, _BidirectionalIterator __last)
first
last
False if wrapped to last permutation, true otherwise.
Treats all permutations of the range as a set of "dictionary" sorted
sequences. Permutes the current sequence into the previous one of this
set. Returns true if there are more sequences to generate. If the
sequence is the smallest of the set, the largest is generated and false
returned.
@brief Permute range into the previous "dictionary" ordering.
prev_permutation(_BidirectionalIterator, _BidirectionalIterator, _Compare) |
template<typename _BidirectionalIterator, typename _Compare> bool prev_permutation( _BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
first
last
comp
False if wrapped to last permutation, true otherwise.
Treats all permutations of the range [first,last) as a set of
"dictionary" sorted sequences ordered by @a comp. Permutes the current
sequence into the previous one of this set. Returns true if there are
more sequences to generate. If the sequence is the smallest of the set,
the largest is generated and false returned.
@brief Permute range into the previous "dictionary" ordering using comparison functor.
random_shuffle(_RandomAccessIterator, _RandomAccessIterator) |
template<typename _RandomAccessIterator> inline void random_shuffle( _RandomAccessIterator __first, _RandomAccessIterator __last)
first
last
Nothing.
Reorder the elements in the range @p [first,last) using a random
distribution, so that every possible ordering of the sequence is
equally likely.
@brief Randomly shuffle the elements of a sequence.
random_shuffle(_RandomAccessIterator, _RandomAccessIterator, _RandomNumberGenerator &) |
template<typename _RandomAccessIterator, typename _RandomNumberGenerator> void random_shuffle( _RandomAccessIterator __first, _RandomAccessIterator __last, _RandomNumberGenerator& __rand)
first
last
rand
Nothing.
Reorders the elements in the range @p [first,last) using @p rand to
provide a random distribution. Calling @p rand(N) for a positive
integer @p N should return a randomly chosen integer from the
range [0,N).
@brief Shuffle the elements of a sequence using a random number generator.
remove |
template<typename _ForwardIterator, typename _Tp> _ForwardIterator remove( _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
first
last
value
An iterator designating the end of the resulting sequence.
All elements equal to @p value are removed from the range
@p [first,last).
remove() is stable, so the relative order of elements that are
not removed is unchanged.
Elements between the end of the resulting sequence and @p last
are still present, but their value is unspecified.
@brief Remove elements from a sequence.
remove_copy |
template<typename _InputIterator, typename _OutputIterator, typename _Tp> _OutputIterator remove_copy( _InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value)
first
last
result
value
An iterator designating the end of the resulting sequence.
Copies each element in the range @p [first,last) not equal to @p value
to the range beginning at @p result.
remove_copy() is stable, so the relative order of elements that are
copied is unchanged.
@brief Copy a sequence, removing elements of a given value.
remove_copy_if |
template<typename _InputIterator, typename _OutputIterator, typename _Predicate> _OutputIterator remove_copy_if( _InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred)
first
last
result
pred
An iterator designating the end of the resulting sequence.
Copies each element in the range @p [first,last) for which
@p pred returns true to the range beginning at @p result.
remove_copy_if() is stable, so the relative order of elements that are
copied is unchanged.
@brief Copy a sequence, removing elements for which a predicate is true.
remove_if |
template<typename _ForwardIterator, typename _Predicate> _ForwardIterator remove_if( _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
first
last
pred
An iterator designating the end of the resulting sequence.
All elements for which @p pred returns true are removed from the range
@p [first,last).
remove_if() is stable, so the relative order of elements that are
not removed is unchanged.
Elements between the end of the resulting sequence and @p last
are still present, but their value is unspecified.
@brief Remove elements from a sequence using a predicate.
replace |
template<typename _ForwardIterator, typename _Tp> void replace( _ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value)
first
last
old_value
new_value
replace() returns no value.
For each iterator @c i in the range @p [first,last) if @c *i ==
@p old_value then the assignment @c *i = @p new_value is performed.
@brief Replace each occurrence of one value in a sequence with another value.
replace_copy |
template<typename _InputIterator, typename _OutputIterator, typename _Tp> _OutputIterator replace_copy( _InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __old_value, const _Tp& __new_value)
first
last
result
old_value
new_value
The end of the output sequence, @p result+(last-first).
Copies each element in the input range @p [first,last) to the
output range @p [result,result+(last-first)) replacing elements
equal to @p old_value with @p new_value.
@brief Copy a sequence, replacing each element of one value with another value.
replace_copy_if |
template<typename _InputIterator, typename _OutputIterator, typename _Predicate, typename _Tp> _OutputIterator replace_copy_if( _InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred, const _Tp& __new_value)
first
last
result
pred
new_value
The end of the output sequence, @p result+(last-first).
Copies each element in the range @p [first,last) to the range
@p [result,result+(last-first)) replacing elements for which
@p pred returns true with @p new_value.
@brief Copy a sequence, replacing each value for which a predicate returns true with another value.
replace_if |
template<typename _ForwardIterator, typename _Predicate, typename _Tp> void replace_if( _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value)
first
last
pred
new_value
replace_if() returns no value.
For each iterator @c i in the range @p [first,last) if @p pred(*i)
is true then the assignment @c *i = @p new_value is performed.
@brief Replace each value in a sequence for which a predicate returns true with another value.
reverse |
template<typename _BidirectionalIterator> inline void reverse( _BidirectionalIterator __first, _BidirectionalIterator __last)
first
last
reverse() returns no value.
Reverses the order of the elements in the range @p [first,last),
so that the first element becomes the last etc.
For every @c i such that @p 0<=i<=(last-first)/2), @p reverse()
swaps @p *(first+i) and @p *(last-(i+1))
@brief Reverse a sequence.
reverse_copy |
template<typename _BidirectionalIterator, typename _OutputIterator> _OutputIterator reverse_copy( _BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
first
last
result
An iterator designating the end of the resulting sequence.
Copies the elements in the range @p [first,last) to the range
@p [result,result+(last-first)) such that the order of the
elements is reversed.
For every @c i such that @p 0<=i<=(last-first), @p reverse_copy()
performs the assignment @p *(result+(last-first)-i) = *(first+i).
The ranges @p [first,last) and @p [result,result+(last-first))
must not overlap.
@brief Copy a sequence, reversing its elements.
rotate_copy |
template<typename _ForwardIterator, typename _OutputIterator> _OutputIterator rotate_copy( _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result)
first
middle
last
result
An iterator designating the end of the resulting sequence.
Copies the elements of the range @p [first,last) to the range
beginning at @result, rotating the copied elements by @p (middle-first)
positions so that the element at @p middle is moved to @p result, the
element at @p middle+1 is moved to @result+1 and so on for each element
in the range @p [first,last).
Performs @p *(result+(n+(last-middle))%(last-first))=*(first+n) for
each @p n in the range @p [0,last-first).
@brief Copy a sequence, rotating its elements.
search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2) |
template<typename _ForwardIterator1, typename _ForwardIterator2> _ForwardIterator1 search( _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2)
first1
last1
first2
last2
The first iterator @c i in the range
@p [first1,last1-(last2-first2)) such that @c *(i+N) == @p *(first2+N)
for each @c N in the range @p [0,last2-first2), or @p last1 if no
such iterator exists.
Searches the range @p [first1,last1) for a sub-sequence that compares
equal value-by-value with the sequence given by @p [first2,last2) and
returns an iterator to the first element of the sub-sequence, or
@p last1 if the sub-sequence is not found.
Because the sub-sequence must lie completely within the range
@p [first1,last1) it must start at a position less than
@p last1-(last2-first2) where @p last2-first2 is the length of the
sub-sequence.
This means that the returned iterator @c i will be in the range
@p [first1,last1-(last2-first2))
@brief Search a sequence for a matching sub-sequence.
search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _BinaryPredicate) |
- _ForwardIter1, _ForwardIter2, _ForwardIter2)
template<typename _ForwardIterator1, typename _ForwardIterator2, typename _BinaryPredicate> _ForwardIterator1 search( _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __predicate)
first1
last1
first2
last2
predicate
The first iterator @c i in the range
@p [first1,last1-(last2-first2)) such that
@p predicate(*(i+N),*(first2+N)) is true for each @c N in the range
@p [0,last2-first2), or @p last1 if no such iterator exists.
Searches the range @p [first1,last1) for a sub-sequence that compares
equal value-by-value with the sequence given by @p [first2,last2),
using @p predicate to determine equality, and returns an iterator
to the first element of the sub-sequence, or @p last1 if no such
iterator exists.
@brief Search a sequence for a matching sub-sequence using a predicate.
search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp &) |
template<typename _ForwardIterator, typename _Integer, typename _Tp> _ForwardIterator search_n( _ForwardIterator __first, _ForwardIterator __last, _Integer __count, const _Tp& __val)
first
last
count
val
The first iterator @c i in the range @p [first,last-count)
such that @c *(i+N) == @p val for each @c N in the range @p [0,count),
or @p last if no such iterator exists.
Searches the range @p [first,last) for @p count consecutive elements
equal to @p val.
@brief Search a sequence for a number of consecutive values.
search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp &, _BinaryPredicate) |
template<typename _ForwardIterator, typename _Integer, typename _Tp, typename _BinaryPredicate> _ForwardIterator search_n( _ForwardIterator __first, _ForwardIterator __last, _Integer __count, const _Tp& __val, _BinaryPredicate __binary_pred)
first
last
count
val
binary_pred
The first iterator @c i in the range @p [first,last-count)
such that @p binary_pred(*(i+N),val) is true for each @c N in the
range @p [0,count), or @p last if no such iterator exists.
Searches the range @p [first,last) for @p count consecutive elements
for which the predicate returns true.
@brief Search a sequence for a number of consecutive values using a predicate.
set_difference(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator) |
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator> _OutputIterator set_difference( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
first1
last1
first2
last2
End of the output range.
@ingroup setoperations
This operation iterates over both ranges, copying elements present in
the first range but not the second in order to the output range.
Iterators increment for each range. When the current element of the
first range is less than the second, that element is copied and the
iterator advances. If the current element of the second range is less,
the iterator advances, but no element is copied. If an element is
contained in both ranges, no elements are copied and both ranges
advance. The output range may not overlap either input range.
@brief Return the difference of two sorted ranges.
set_difference(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator, _Compare) |
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator, typename _Compare> _OutputIterator set_difference( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
first1
last1
first2
last2
comp
End of the output range.
@ingroup setoperations
This operation iterates over both ranges, copying elements present in
the first range but not the second in order to the output range.
Iterators increment for each range. When the current element of the
first range is less than the second according to @a comp, that element
is copied and the iterator advances. If the current element of the
second range is less, no element is copied and the iterator advances.
If an element is contained in both ranges according to @a comp, no
elements are copied and both ranges advance. The output range may not
overlap either input range.
@brief Return the difference of two sorted ranges using comparison functor.
set_intersection(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator) |
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator> _OutputIterator set_intersection( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
first1
last1
first2
last2
End of the output range.
@ingroup setoperations
This operation iterates over both ranges, copying elements present in
both ranges in order to the output range. Iterators increment for each
range. When the current element of one range is less than the other,
that iterator advances. If an element is contained in both ranges, the
element from the first range is copied and both ranges advance. The
output range may not overlap either input range.
@brief Return the intersection of two sorted ranges.
set_intersection(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator, _Compare) |
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator, typename _Compare> _OutputIterator set_intersection( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
first1
last1
first2
last2
comp
End of the output range.
@ingroup setoperations
This operation iterates over both ranges, copying elements present in
both ranges in order to the output range. Iterators increment for each
range. When the current element of one range is less than the other
according to @a comp, that iterator advances. If an element is
contained in both ranges according to @a comp, the element from the
first range is copied and both ranges advance. The output range may not
overlap either input range.
@brief Return the intersection of two sorted ranges using comparison functor.
set_symmetric_difference(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator) |
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator> _OutputIterator set_symmetric_difference( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
first1
last1
first2
last2
End of the output range.
@ingroup setoperations
This operation iterates over both ranges, copying elements present in
one range but not the other in order to the output range. Iterators
increment for each range. When the current element of one range is less
than the other, that element is copied and the iterator advances. If an
element is contained in both ranges, no elements are copied and both
ranges advance. The output range may not overlap either input range.
@brief Return the symmetric difference of two sorted ranges.
set_symmetric_difference(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator, _Compare) |
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator, typename _Compare> _OutputIterator set_symmetric_difference( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
first1
last1
first2
last2
comp
End of the output range.
@ingroup setoperations
This operation iterates over both ranges, copying elements present in
one range but not the other in order to the output range. Iterators
increment for each range. When the current element of one range is less
than the other according to @a comp, that element is copied and the
iterator advances. If an element is contained in both ranges according
to @a comp, no elements are copied and both ranges advance. The output
range may not overlap either input range.
@brief Return the symmetric difference of two sorted ranges using comparison functor.
set_union(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator) |
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator> _OutputIterator set_union( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
first1
last1
first2
last2
End of the output range.
@ingroup setoperations
This operation iterates over both ranges, copying elements present in
each range in order to the output range. Iterators increment for each
range. When the current element of one range is less than the other,
that element is copied and the iterator advanced. If an element is
contained in both ranges, the element from the first range is copied and
both ranges advance. The output range may not overlap either input
range.
@brief Return the union of two sorted ranges.
set_union(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator, _Compare) |
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator, typename _Compare> _OutputIterator set_union( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
first1
last1
first2
last2
comp
End of the output range.
@ingroup setoperations
This operation iterates over both ranges, copying elements present in
each range in order to the output range. Iterators increment for each
range. When the current element of one range is less than the other
according to @a comp, that element is copied and the iterator advanced.
If an equivalent element according to @a comp is contained in both
ranges, the element from the first range is copied and both ranges
advance. The output range may not overlap either input range.
@brief Return the union of two sorted ranges using a comparison functor.
sort(_RandomAccessIterator, _RandomAccessIterator) |
template<typename _RandomAccessIterator> inline void sort( _RandomAccessIterator __first, _RandomAccessIterator __last)
first
last
Nothing.
Sorts the elements in the range @p [first,last) in ascending order,
such that @p *(i+1)<*i is false for each iterator @p i in the range
@p [first,last-1).
The relative ordering of equivalent elements is not preserved, use
@p stable_sort() if this is needed.
@brief Sort the elements of a sequence.
sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) |
template<typename _RandomAccessIterator, typename _Compare> inline void sort( _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
first
last
comp
Nothing.
Sorts the elements in the range @p [first,last) in ascending order,
such that @p comp(*(i+1),*i) is false for every iterator @p i in the
range @p [first,last-1).
The relative ordering of equivalent elements is not preserved, use
@p stable_sort() if this is needed.
@brief Sort the elements of a sequence using a predicate for comparison.
swap_ranges |
template<typename _ForwardIterator1, typename _ForwardIterator2> _ForwardIterator2 swap_ranges( _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2)
first1
last1
first2
An iterator equal to @p first2+(last1-first1).
Swaps each element in the range @p [first1,last1) with the
corresponding element in the range @p [first2,(last1-first1)).
The ranges must not overlap.
@brief Swap the elements of two sequences.
transform(_InputIterator, _InputIterator, _OutputIterator, _UnaryOperation) |
template<typename _InputIterator, typename _OutputIterator, typename _UnaryOperation> _OutputIterator transform( _InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __unary_op)
first
last
result
unary_op
An output iterator equal to @p result+(last-first).
Applies the operator to each element in the input range and assigns
the results to successive elements of the output sequence.
Evaluates @p *(result+N)=unary_op(*(first+N)) for each @c N in the
range @p [0,last-first).
@p unary_op must not alter its argument.
@brief Perform an operation on a sequence.
transform(_InputIterator1, _InputIterator1, _InputIterator2, _OutputIterator, _BinaryOperation) |
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator, typename _BinaryOperation> _OutputIterator transform( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _BinaryOperation __binary_op)
first1
last1
first2
result
binary_op
An output iterator equal to @p result+(last-first).
Applies the operator to the corresponding elements in the two
input ranges and assigns the results to successive elements of the
output sequence.
Evaluates @p *(result+N)=binary_op(*(first1+N),*(first2+N)) for each
@c N in the range @p [0,last1-first1).
@p binary_op must not alter either of its arguments.
@brief Perform an operation on corresponding elements of two sequences.
unique(_ForwardIterator, _ForwardIterator) |
template<typename _ForwardIterator> _ForwardIterator unique( _ForwardIterator __first, _ForwardIterator __last)
first
last
An iterator designating the end of the resulting sequence.
Removes all but the first element from each group of consecutive
values that compare equal.
unique() is stable, so the relative order of elements that are
not removed is unchanged.
Elements between the end of the resulting sequence and @p last
are still present, but their value is unspecified.
@brief Remove consecutive duplicate values from a sequence.
unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate) |
template<typename _ForwardIterator, typename _BinaryPredicate> _ForwardIterator unique( _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __binary_pred)
first
last
binary_pred
An iterator designating the end of the resulting sequence.
Removes all but the first element from each group of consecutive
values for which @p binary_pred returns true.
unique() is stable, so the relative order of elements that are
not removed is unchanged.
Elements between the end of the resulting sequence and @p last
are still present, but their value is unspecified.
@brief Remove consecutive values from a sequence using a predicate.
upper_bound(_ForwardIterator, _ForwardIterator, const _Tp &) |
template<typename _ForwardIterator, typename _Tp> _ForwardIterator upper_bound( _ForwardIterator __first, _ForwardIterator __last, const _Tp& __val)
first
last
val
An iterator pointing to the first element greater than @a val, or end() if no elements are greater than @a val. @ingroup binarysearch
@brief Finds the last position in which @a val could be inserted without changing the ordering.
upper_bound(_ForwardIterator, _ForwardIterator, const _Tp &, _Compare) |
template<typename _ForwardIterator, typename _Tp, typename _Compare> _ForwardIterator upper_bound( _ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp)
first
last
val
comp
An iterator pointing to the first element greater than @a val,
or end() if no elements are greater than @a val.
@ingroup binarysearch
The comparison function should have the same effects on ordering as
the function used for the initial sort.
@brief Finds the last position in which @a val could be inserted without changing the ordering.
__unguarded_insertion_sort |
template<typename _RandomAccessIterator> inline void __unguarded_insertion_sort( _RandomAccessIterator __first, _RandomAccessIterator __last)
@if maint This is a helper function for the sort routine. @endif
__unguarded_insertion_sort |
template<typename _RandomAccessIterator, typename _Compare> inline void __unguarded_insertion_sort( _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
@if maint This is a helper function for the sort routine. @endif
inplace_merge |
template<typename _BidirectionalIterator> void inplace_merge( _BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last)
@brief Merges two sorted ranges in place.
inplace_merge |
template<typename _BidirectionalIterator, typename _Compare> void inplace_merge( _BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, _Compare __comp)
@brief Merges two sorted ranges in place.
partial_sort |
template<typename _RandomAccessIterator> void partial_sort( _RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
@brief Sort the smallest elements of a sequence.
partial_sort |
template<typename _RandomAccessIterator, typename _Compare> void partial_sort( _RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, _Compare __comp)
@brief Sort the smallest elements of a sequence using a predicate for comparison.
rotate |
template<typename _ForwardIterator> inline void rotate( _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
@brief Rotate the elements of a sequence.
stable_partition |
template<typename _ForwardIterator, typename _Predicate> _ForwardIterator stable_partition( _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
@brief Move elements for which a predicate is true to the beginning of a sequence, preserving relative ordering.
stable_sort |
template<typename _RandomAccessIterator> inline void stable_sort( _RandomAccessIterator __first, _RandomAccessIterator __last)
@brief Sort the elements of a sequence, preserving the relative order of equivalent elements.
stable_sort |
template<typename _RandomAccessIterator, typename _Compare> inline void stable_sort( _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
@brief Sort the elements of a sequence using a predicate for comparison, preserving the relative order of equivalent elements.
unique_copy |
template<typename _InputIterator, typename _OutputIterator> inline _OutputIterator unique_copy( _InputIterator __first, _InputIterator __last, _OutputIterator __result)
@brief Copy a sequence, removing consecutive duplicate values.
unique_copy |
template<typename _InputIterator, typename _OutputIterator, typename _BinaryPredicate> inline _OutputIterator unique_copy( _InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __binary_pred)
@brief Copy a sequence, removing consecutive values using a predicate.
|