stl_iterator_base_funcs.h File Reference

#include <bits/concept_check.h>

Include dependency graph for stl_iterator_base_funcs.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  std

Functions

template<typename InputIterator>
iterator_traits< InputIterator
>::difference_type 
distance (InputIterator first, InputIterator last)
 A generalization of pointer arithmetic.
template<typename InputIterator, typename Distance>
void advance (InputIterator &__i, Distance n)
 A generalization of pointer arithmetic.


Detailed Description

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().

Definition in file stl_iterator_base_funcs.h.


Function Documentation

template<typename InputIterator, typename Distance>
void std::advance InputIterator &  __i,
Distance  n
[inline]
 

A generalization of pointer arithmetic.

Parameters:
i An input iterator.
n The "delta" by which to change i.
Returns:
Nothing.
This increments i by n. For bidirectional and random access iterators, n may be negative, in which case i is decremented.

For random access iterators, this uses their + and - operations and are constant time. For other iterator classes they are linear time.

Definition at line 172 of file stl_iterator_base_funcs.h.

template<typename InputIterator>
iterator_traits<InputIterator>::difference_type std::distance InputIterator  first,
InputIterator  last
[inline]
 

A generalization of pointer arithmetic.

Parameters:
first An input iterator.
last An input iterator.
Returns:
The distance between them.
Returns n such that first + n == last. This requires that last must be reachable from first. Note that n may be negative.

For random access iterators, this uses their + and - operations and are constant time. For other iterator classes they are linear time.

Definition at line 114 of file stl_iterator_base_funcs.h.

Referenced by std::equal_range(), std::inplace_merge(), std::lower_bound(), __gnu_cxx::random_sample_n(), std::list< Type, Allocator >::size(), and std::upper_bound().


Generated on Fri May 6 01:11:30 2005 for libstdc++-v3 Source by  doxygen 1.4.2