Standard C++ Library Reference ISO/IEC (VERSION3)

istreambuf_iterator::traits_type
typedef Tr traits_type;
The type is a synonym for the template parameter Tr.
iterator
template<class Category, class Ty, class Diff = ptrdiff_t
class Pointer = Ty *, class Reference = Ty&>
struct iterator {
typedef Category iterator_category;
typedef Ty value_type;
typedef Diff difference_type;
typedef Pointer pointer;
typedef Reference reference;
};
The template class can serve as a convenient base class for an iterator class that you define. It defines
the member types iterator_category (a synonym for the template parameter Category),
value_type (a synonym for the template parameter Ty), difference_type (a synonym for the
template parameter Diff), pointer (a synonym for the template parameter Pointer), and
reference (a synonym for the template parameter Reference).
Note that value_type should not be a constant type even if pointer points at an object of const
type and reference designates an object of const type.
iterator_traits
template<class Iter>
struct iterator_traits {
typedef typename Iter::iterator_category iterator_category;
typedef typename Iter::value_type value_type;
typedef typename Iter::difference_type difference_type;
typedef typename Iter::pointer pointer;
typedef typename Iter::reference reference;
};
template<class Ty>
struct iterator_traits<Ty *> {
typedef random_access_iterator_tag iterator_category;
typedef Ty value_type;
typedef ptrdiff_t difference_type;
typedef Ty *pointer;
typedef Ty& reference;
};
template<class Ty>
struct iterator_traits<const Ty *> {
typedef random_access_iterator_tag iterator_category;