1 <?xml version=
"1.0" encoding=
"utf-8" ?>
2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
6 <meta name=
"generator" content=
"Docutils 0.11: http://docutils.sourceforge.net/" />
7 <title>Iterator Traits
</title>
8 <meta name=
"author" content=
"David Abrahams" />
9 <meta name=
"organization" content=
"Boost Consulting" />
10 <meta name=
"date" content=
"$Date$" />
11 <meta name=
"copyright" content=
"Copyright David Abrahams 2004." />
12 <link rel=
"stylesheet" href=
"../../../rst.css" type=
"text/css" />
15 <div class=
"document" id=
"iterator-traits">
16 <h1 class=
"title">Iterator Traits
</h1>
17 <table class=
"docinfo" frame=
"void" rules=
"none">
18 <col class=
"docinfo-name" />
19 <col class=
"docinfo-content" />
21 <tr><th class=
"docinfo-name">Author:
</th>
22 <td>David Abrahams
</td></tr>
23 <tr><th class=
"docinfo-name">Contact:
</th>
24 <td><a class=
"first last reference external" href=
"mailto:dave@boost-consulting.com">dave
@boost-consulting.com
</a></td></tr>
25 <tr><th class=
"docinfo-name">Organization:
</th>
26 <td><a class=
"first last reference external" href=
"http://www.boost-consulting.com">Boost Consulting
</a></td></tr>
27 <tr><th class=
"docinfo-name">Date:
</th>
29 <tr><th class=
"docinfo-name">Copyright:
</th>
30 <td>Copyright David Abrahams
2004.
</td></tr>
33 <!-- Distributed under the Boost -->
34 <!-- Software License, Version 1.0. (See accompanying -->
35 <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
36 <table class=
"docutils field-list" frame=
"void" rules=
"none">
37 <col class=
"field-name" />
38 <col class=
"field-body" />
40 <tr class=
"field"><th class=
"field-name">abstract:
</th><td class=
"field-body">Header
<tt class=
"docutils literal"><boost/iterator/iterator_traits.hpp
></tt> provides
41 the ability to access an iterator's associated types using
42 MPL-compatible
<a class=
"reference external" href=
"../../mpl/doc/index.html#metafunctions">metafunctions
</a>.
</td>
46 <div class=
"section" id=
"overview">
48 <p><tt class=
"docutils literal"><span class=
"pre">std::iterator_traits
</span></tt> provides access to five associated types
49 of any iterator: its
<tt class=
"docutils literal">value_type
</tt>,
<tt class=
"docutils literal">reference
</tt>,
<tt class=
"docutils literal">pointer
</tt>,
50 <tt class=
"docutils literal">iterator_category
</tt>, and
<tt class=
"docutils literal">difference_type
</tt>. Unfortunately,
51 such a
"multi-valued
" traits template can be difficult to use in a
52 metaprogramming context.
<tt class=
"docutils literal"><boost/iterator/iterator_traits.hpp
></tt>
53 provides access to these types using a standard
<a class=
"reference external" href=
"../../mpl/doc/index.html#metafunctions">metafunctions
</a>.
</p>
55 <div class=
"section" id=
"summary">
57 <p>Header
<tt class=
"docutils literal"><boost/iterator/iterator_traits.hpp
></tt>:
</p>
58 <pre class=
"literal-block">
59 template
<class Iterator
>
63 std::iterator_traits
<Iterator
>::value_type
67 template
<class Iterator
>
68 struct iterator_reference
71 std::iterator_traits
<Iterator
>::reference
76 template
<class Iterator
>
77 struct iterator_pointer
80 std::iterator_traits
<Iterator
>::pointer
84 template
<class Iterator
>
85 struct iterator_difference
88 detail::iterator_traits
<Iterator
>::difference_type
92 template
<class Iterator
>
93 struct iterator_category
96 detail::iterator_traits
<Iterator
>::iterator_category
103 <hr class=
"footer" />
104 <a class=
"reference external" href=
"iterator_traits.rst">View document source
</a>.
105 Generated by
<a class=
"reference external" href=
"http://docutils.sourceforge.net/">Docutils
</a> from
<a class=
"reference external" href=
"http://docutils.sourceforge.net/rst.html">reStructuredText
</a> source.