1 .. Distributed under the Boost
2 .. Software License, Version 1.0. (See accompanying
3 .. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 :Author: David Abrahams
10 :Contact: dave@boost-consulting.com
11 :organization: `Boost Consulting`_
13 :copyright: Copyright David Abrahams 2004.
15 .. _`Boost Consulting`: http://www.boost-consulting.com
17 :abstract: Header ``<boost/iterator/iterator_traits.hpp>`` provides
18 the ability to access an iterator's associated types using
19 MPL-compatible metafunctions_.
21 .. _metafunctions: ../../mpl/doc/index.html#metafunctions
26 ``std::iterator_traits`` provides access to five associated types
27 of any iterator: its ``value_type``, ``reference``, ``pointer``,
28 ``iterator_category``, and ``difference_type``. Unfortunately,
29 such a "multi-valued" traits template can be difficult to use in a
30 metaprogramming context. ``<boost/iterator/iterator_traits.hpp>``
31 provides access to these types using a standard metafunctions_.
36 Header ``<boost/iterator/iterator_traits.hpp>``::
38 template <class Iterator>
42 std::iterator_traits<Iterator>::value_type
46 template <class Iterator>
47 struct iterator_reference
50 std::iterator_traits<Iterator>::reference
55 template <class Iterator>
56 struct iterator_pointer
59 std::iterator_traits<Iterator>::pointer
63 template <class Iterator>
64 struct iterator_difference
67 detail::iterator_traits<Iterator>::difference_type
71 template <class Iterator>
72 struct iterator_category
75 detail::iterator_traits<Iterator>::iterator_category