|
ADC Home > Reference Library > Reference > Darwin > Miscellaneous User Space API Reference
|
stl_algobase.h |
| Includes: | <bits/c++config.h> <cstring> <climits> <cstdlib> <cstddef> <iosfwd> <bits/stl_pair.h> <bits/cpp_type_traits.h> <bits/stl_iterator_base_types.h> <bits/stl_iterator_base_funcs.h> <bits/stl_iterator.h> <bits/concept_check.h> <debug/debug.h> <bits/c++config.h> <cstring> <climits> <cstdlib> <cstddef> <new> <iosfwd> <bits/stl_pair.h> <bits/type_traits.h> <bits/stl_iterator_base_types.h> <bits/stl_iterator_base_funcs.h> <bits/stl_iterator.h> <bits/concept_check.h> <debug/debug.h> <bits/c++config.h> <cstring> <climits> <cstdlib> <cstddef> <iosfwd> <bits/stl_pair.h> <bits/cpp_type_traits.h> <bits/stl_iterator_base_types.h> <bits/stl_iterator_base_funcs.h> <bits/stl_iterator.h> <bits/concept_check.h> <debug/debug.h> |
This is an internal header file, included by other library headers. You should not attempt to use it directly.
copy |
template<typename _InputIterator, typename _OutputIterator> inline _OutputIterator copy( _InputIterator __first, _InputIterator __last, _OutputIterator __result)
firstlastresultresult + (first - last)
This inline function will boil down to a call to @c memmove whenever
possible. Failing that, if random access iterators are passed, then the
loop count will be known (and therefore a candidate for compiler
optimizations such as unrolling). Result may not be contained within
[first,last); the copy_backward function should be used instead.
Note that the end of the output range is permitted to be contained
within [first,last).
@brief Copies the range [first,last) into result.
copy_backward |
template <typename _BI1, typename _BI2> inline _BI2 copy_backward( _BI1 __first, _BI1 __last, _BI2 __result)
firstlastresultresult - (first - last)
The function has the same effect as copy, but starts at the end of the
range and works its way to the start, returning the start of the result.
This inline function will boil down to a call to @c memmove whenever
possible. Failing that, if random access iterators are passed, then the
loop count will be known (and therefore a candidate for compiler
optimizations such as unrolling).
Result may not be in the range [first,last). Use copy instead. Note
that the start of the output range may overlap [first,last).
@brief Copies the range [first,last) into result.
equal(_InputIterator1, _InputIterator1, _InputIterator2) |
template<typename _InputIterator1, typename _InputIterator2> inline bool equal( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2)
first1last1first2A boolean true or false.
This compares the elements of two ranges using @c == and returns true or
false depending on whether all of the corresponding elements of the
ranges are equal.
@brief Tests a range for element-wise equality.
equal(_InputIterator1, _InputIterator1, _InputIterator2, _BinaryPredicate) |
template<typename _InputIterator1, typename _InputIterator2, typename _BinaryPredicate> inline bool equal( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __binary_pred)
first1last1binary_predA boolean true or false.
This compares the elements of two ranges using the binary_pred
parameter, and returns true or
false depending on whether all of the corresponding elements of the
ranges are equal.
@brief Tests a range for element-wise equality.
fill |
template<typename _ForwardIterator, typename _Tp> void fill( _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
firstlastvalueNothing.
This function fills a range with copies of the same value. For one-byte
types filling contiguous areas of memory, this becomes an inline call to
@c memset.
@brief Fills the range [first,last) with copies of value.
fill_n |
template<typename _OutputIterator, typename _Size, typename _Tp> _OutputIterator fill_n( _OutputIterator __first, _Size __n, const _Tp& __value)
firstnvalueThe iterator at first+n.
This function fills a range with copies of the same value. For one-byte
types filling contiguous areas of memory, this becomes an inline call to
@c memset.
@brief Fills the range [first,first+n) with copies of value.
lexicographical_compare(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2) |
template<typename _InputIterator1, typename _InputIterator2> bool lexicographical_compare( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2)
first1last1first2last2A boolean true or false.
"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). Returns false otherwise."
(Quoted from [25.3.8]/1.) If the iterators are all character pointers,
then this is an inline call to @c memcmp.
@brief Performs "dictionary" comparison on ranges.
lexicographical_compare(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _Compare) |
template<typename _InputIterator1, typename _InputIterator2, typename _Compare> bool lexicographical_compare( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
first1last1first2compA boolean true or false.
The same as the four-parameter @c lexigraphical_compare, but uses the
comp parameter instead of @c <.
@brief Performs "dictionary" comparison on ranges.
max(const _Tp &, const _Tp &) |
template<typename _Tp> inline const _Tp& max( const _Tp& __a, const _Tp& __b)
abThe greater of the parameters.
This is the simple classic generic implementation. It will work on
temporary expressions, since they are only evaluated once, unlike a
preprocessor macro.
@brief This does what you think it does.
max(const _Tp &, const _Tp &, _Compare) |
template<typename _Tp, typename _Compare> inline const _Tp& max( const _Tp& __a, const _Tp& __b, _Compare __comp)
acompThe greater of the parameters.
This will work on temporary expressions, since they are only evaluated
once, unlike a preprocessor macro.
@brief This does what you think it does.
min(const _Tp &, const _Tp &) |
template<typename _Tp> inline const _Tp& min( const _Tp& __a, const _Tp& __b)
abThe lesser of the parameters.
This is the simple classic generic implementation. It will work on
temporary expressions, since they are only evaluated once, unlike a
preprocessor macro.
@brief This does what you think it does.
min(const _Tp &, const _Tp &, _Compare) |
template<typename _Tp, typename _Compare> inline const _Tp& min( const _Tp& __a, const _Tp& __b, _Compare __comp)
acompThe lesser of the parameters.
This will work on temporary expressions, since they are only evaluated
once, unlike a preprocessor macro.
@brief This does what you think it does.
mismatch(_InputIterator1, _InputIterator1, _InputIterator2) |
template<typename _InputIterator1, typename _InputIterator2> pair<_InputIterator1, _InputIterator2> mismatch( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2)
first1last1first2A pair of iterators pointing to the first mismatch.
This compares the elements of two ranges using @c == and returns a pair
of iterators. The first iterator points into the first range, the
second iterator points into the second range, and the elements pointed
to by the iterators are not equal.
@brief Finds the places in ranges which don't match.
mismatch(_InputIterator1, _InputIterator1, _InputIterator2, _BinaryPredicate) |
template<typename _InputIterator1, typename _InputIterator2, typename _BinaryPredicate> pair<_InputIterator1, _InputIterator2> mismatch( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __binary_pred)
first1last1binary_predA pair of iterators pointing to the first mismatch.
This compares the elements of two ranges using the binary_pred
parameter, and returns a pair
of iterators. The first iterator points into the first range, the
second iterator points into the second range, and the elements pointed
to by the iterators are not equal.
@brief Finds the places in ranges which don't match.
swap |
template<typename _Tp> inline void swap( _Tp& __a, _Tp& __b)
abNothing.
This is the simple classic generic implementation. It will work on
any type which has a copy constructor and an assignment operator.
@brief Swaps two values.
iter_swap |
template<typename _ForwardIterator1, typename _ForwardIterator2> inline void iter_swap( _ForwardIterator1 __a, _ForwardIterator2 __b)
@brief Swaps the contents of two iterators.
|