Standard C++ Library Reference ISO/IEC (VERSION3)
typedef Ty value_type;
typedef ptrdiff_t difference_type;
typedef const Ty *pointer;
typedef const Tr& reference;
};
The template class determines several critical types associated with the iterator type Iter. It defines
the member types iterator_category (a synonym for Iter::iterator_category),
value_type (a synonym for Iter::value_type), difference_type (a synonym for
Iter::difference_type), pointer (a synonym for Iter::pointer), and reference (a
synonym for Iter::reference).
The partial specializations determine the critical types associated with an object pointer type Ty * or
const Ty *. In this implementation, you can also use several template functions that do not make
use of partial specialization:
template<class Category, class Ty, class Diff>
C _Iter_cat(const iterator<Category, Ty, Diff>&);
template<class Ty>
random_access_iterator_tag _Iter_cat(const Ty *);
template<class Category, class Ty, class Diff>
Ty *_Val_type(const iterator<Category, Ty, Diff>&);
template<class Ty>
Ty *_Val_type(const Ty *);
template<class Category, class Ty, class Diff>
Diff *_Dist_type(const iterator<Category, Ty, Diff>&);
template<class Ty>
ptrdiff_t *_Dist_type(const Ty *);
which determine several of the same types a bit more indirectly. You use these functions as arguments
on a function call. Their sole purpose is to supply a useful template class parameter to the called
function.
operator!=
template<class RanIt>
bool operator!=(
const reverse_iterator<RanIt>& left,
const reverse_iterator<RanIt>& right);
template<class Ty, class Elem, class Tr, class Diff>
bool operator!=(
const istream_iterator<Ty, Elem, Tr, Diff>& left,
const istream_iterator<Ty, Elem, Tr, Diff>& right);
template<class Elem, class Tr>
bool operator!=(
const istreambuf_iterator<Elem, Tr>& left,
const istreambuf_iterator<Elem, Tr>& right);