ADC Home > Reference Library > Reference > Darwin > Miscellaneous User Space API Reference
|
stl_iterator_base_funcs.h |
This is an internal header file, included by other library headers.
You should not attempt to use it directly.
This file contains all of the general iterator-related utility
functions, such as distance() and advance().
advance |
template<typename _InputIterator, typename _Distance> inline void advance( _InputIterator& __i, _Distance __n)
i
n
Nothing.
This increments @p i by @p n. For bidirectional and random access
iterators, @p n may be negative, in which case @p i is decremented.
For random access iterators, this uses their @c + and @c - operations
and are constant time. For other %iterator classes they are linear time.
@brief A generalization of pointer arithmetic.
distance |
template<typename _InputIterator> inline typename iterator_traits<_InputIterator>::difference_type distance( _InputIterator __first, _InputIterator __last)
first
last
The distance between them.
Returns @c n such that first + n == last. This requires that @p last
must be reachable from @p first. Note that @c n may be negative.
For random access iterators, this uses their @c + and @c - operations
and are constant time. For other %iterator classes they are linear time.
@brief A generalization of pointer arithmetic.