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.5: http://docutils.sourceforge.net/" />
7 <title>Iterator Archetype
</title>
8 <meta name=
"author" content=
"David Abrahams, Jeremy Siek, Thomas Witt" />
9 <meta name=
"organization" content=
"Boost Consulting, Indiana University Open Systems Lab, Zephyr Associates, Inc." />
10 <meta name=
"date" content=
"2006-09-11" />
11 <meta name=
"copyright" content=
"Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2004." />
12 <link rel=
"stylesheet" href=
"../../../rst.css" type=
"text/css" />
15 <div class=
"document" id=
"iterator-archetype">
16 <h1 class=
"title">Iterator Archetype
</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, Jeremy Siek, Thomas Witt
</td></tr>
23 <tr><th class=
"docinfo-name">Contact:
</th>
24 <td><a class=
"first reference external" href=
"mailto:dave@boost-consulting.com">dave
@boost-consulting.com
</a>,
<a class=
"reference external" href=
"mailto:jsiek@osl.iu.edu">jsiek
@osl.iu.edu
</a>,
<a class=
"last reference external" href=
"mailto:witt@styleadvisor.com">witt
@styleadvisor.com
</a></td></tr>
25 <tr><th class=
"docinfo-name">Organization:
</th>
26 <td><a class=
"first reference external" href=
"http://www.boost-consulting.com">Boost Consulting
</a>, Indiana University
<a class=
"reference external" href=
"http://www.osl.iu.edu">Open Systems
27 Lab
</a>,
<a class=
"last reference external" href=
"http://www.styleadvisor.com">Zephyr Associates, Inc.
</a></td></tr>
28 <tr><th class=
"docinfo-name">Date:
</th>
29 <td>2006-
09-
11</td></tr>
30 <tr><th class=
"docinfo-name">Copyright:
</th>
31 <td>Copyright David Abrahams, Jeremy Siek, and Thomas Witt
2004.
</td></tr>
34 <!-- Distributed under the Boost -->
35 <!-- Software License, Version 1.0. (See accompanying -->
36 <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
37 <table class=
"docutils field-list" frame=
"void" rules=
"none">
38 <col class=
"field-name" />
39 <col class=
"field-body" />
41 <tr class=
"field"><th class=
"field-name">abstract:
</th><td class=
"field-body">The
<tt class=
"docutils literal"><span class=
"pre">iterator_archetype
</span></tt> class constructs a minimal implementation of
42 one of the iterator access concepts and one of the iterator traversal concepts.
43 This is used for doing a compile-time check to see if a the type requirements
44 of a template are really enough to cover the implementation of the template.
45 For further information see the documentation for the
<a class=
"reference external" href=
"../../concept_check/index.html"><tt class=
"docutils literal"><span class=
"pre">boost::concept_check
</span></tt></a> library.
</td>
49 <div class=
"contents topic" id=
"table-of-contents">
50 <p class=
"topic-title first">Table of Contents
</p>
52 <li><a class=
"reference internal" href=
"#reference" id=
"id1">Reference
</a><ul>
53 <li><a class=
"reference internal" href=
"#iterator-archetype-synopsis" id=
"id2"><tt class=
"docutils literal"><span class=
"pre">iterator_archetype
</span></tt> Synopsis
</a></li>
54 <li><a class=
"reference internal" href=
"#access-category-tags" id=
"id3"><tt class=
"docutils literal"><span class=
"pre">Access
</span> <span class=
"pre">Category
</span> <span class=
"pre">Tags
</span></tt></a></li>
55 <li><a class=
"reference internal" href=
"#iterator-archetype-requirements" id=
"id4"><tt class=
"docutils literal"><span class=
"pre">iterator_archetype
</span></tt> Requirements
</a></li>
56 <li><a class=
"reference internal" href=
"#iterator-archetype-models" id=
"id5"><tt class=
"docutils literal"><span class=
"pre">iterator_archetype
</span></tt> Models
</a></li>
57 <li><a class=
"reference internal" href=
"#traits" id=
"id6"><tt class=
"docutils literal"><span class=
"pre">Traits
</span></tt></a></li>
62 <div class=
"section" id=
"reference">
63 <h1><a class=
"toc-backref" href=
"#id1">Reference
</a></h1>
64 <div class=
"section" id=
"iterator-archetype-synopsis">
65 <h2><a class=
"toc-backref" href=
"#id2"><tt class=
"docutils literal"><span class=
"pre">iterator_archetype
</span></tt> Synopsis
</a></h2>
66 <pre class=
"literal-block">
67 namespace iterator_archetypes
71 typedef /*implementation defined*/ readable_iterator_t;
72 typedef /*implementation defined*/ writable_iterator_t;
73 typedef /*implementation defined*/ readable_writable_iterator_t;
74 typedef /*implementation defined*/ readable_lvalue_iterator_t;
75 typedef /*implementation defined*/ writable_lvalue_iterator_t;
81 , class AccessCategory
82 , class TraversalCategory
84 class iterator_archetype
86 typedef /* see below */ value_type;
87 typedef /* see below */ reference;
88 typedef /* see below */ pointer;
89 typedef /* see below */ difference_type;
90 typedef /* see below */ iterator_category;
94 <div class=
"section" id=
"access-category-tags">
95 <h2><a class=
"toc-backref" href=
"#id3"><tt class=
"docutils literal"><span class=
"pre">Access
</span> <span class=
"pre">Category
</span> <span class=
"pre">Tags
</span></tt></a></h2>
96 <p>The access category types provided correspond to the following
97 standard iterator access concept combinations:
</p>
98 <pre class=
"literal-block">
99 readable_iterator_t :=
103 writable_iterator_t :=
107 readable_writable_iterator_t :=
109 Readable Iterator
& Writeable Iterator
& Swappable Iterator
111 readable_lvalue_iterator_t :=
113 Readable Iterator
& Lvalue Iterator
115 writeable_lvalue_iterator_t :=
117 Readable Iterator
& Writeable Iterator
& Swappable Iterator
& Lvalue Iterator
120 <div class=
"section" id=
"iterator-archetype-requirements">
121 <h2><a class=
"toc-backref" href=
"#id4"><tt class=
"docutils literal"><span class=
"pre">iterator_archetype
</span></tt> Requirements
</a></h2>
122 <p>The
<tt class=
"docutils literal"><span class=
"pre">AccessCategory
</span></tt> argument must be one of the predefined access
123 category tags. The
<tt class=
"docutils literal"><span class=
"pre">TraversalCategory
</span></tt> must be one of the standard
124 traversal tags. The
<tt class=
"docutils literal"><span class=
"pre">Value
</span></tt> type must satisfy the requirements of
125 the iterator concept specified by
<tt class=
"docutils literal"><span class=
"pre">AccessCategory
</span></tt> and
126 <tt class=
"docutils literal"><span class=
"pre">TraversalCategory
</span></tt> as implied by the nested traits types.
</p>
128 <div class=
"section" id=
"iterator-archetype-models">
129 <h2><a class=
"toc-backref" href=
"#id5"><tt class=
"docutils literal"><span class=
"pre">iterator_archetype
</span></tt> Models
</a></h2>
130 <p><tt class=
"docutils literal"><span class=
"pre">iterator_archetype
</span></tt> models the iterator concepts specified by the
131 <tt class=
"docutils literal"><span class=
"pre">AccessCategory
</span></tt> and
<tt class=
"docutils literal"><span class=
"pre">TraversalCategory
</span></tt>
132 arguments.
<tt class=
"docutils literal"><span class=
"pre">iterator_archetype
</span></tt> does not model any other access
133 concepts or any more derived traversal concepts.
</p>
135 <div class=
"section" id=
"traits">
136 <h2><a class=
"toc-backref" href=
"#id6"><tt class=
"docutils literal"><span class=
"pre">Traits
</span></tt></a></h2>
137 <p>The nested trait types are defined as follows:
</p>
138 <pre class=
"literal-block">
139 if (AccessCategory == readable_iterator_t)
145 else if (AccessCategory == writable_iterator_t)
151 else if (AccessCategory == readable_writable_iterator_t)
157 A type X that is convertible to Value for which the following
158 expression is valid. Given an object x of type X and v of type
165 else if (AccessCategory == readable_lvalue_iterator_t)
168 reference = Value const
&
169 pointer = Value const*
171 else if (AccessCategory == writable_lvalue_iterator_t)
174 reference = Value
&
177 if ( TraversalCategory is convertible to forward_traversal_tag )
179 difference_type := ptrdiff_t
183 difference_type := unspecified type
188 A type X satisfying the following two constraints:
190 1. X is convertible to X1, and not to any more-derived
191 type, where X1 is defined by:
193 if (reference is a reference type
194 && TraversalCategory is convertible to forward_traversal_tag)
196 if (TraversalCategory is convertible to random_access_traversal_tag)
197 X1 = random_access_iterator_tag
198 else if (TraversalCategory is convertible to bidirectional_traversal_tag)
199 X1 = bidirectional_iterator_tag
201 X1 = forward_iterator_tag
205 if (TraversalCategory is convertible to single_pass_traversal_tag
206 && reference != void)
207 X1 = input_iterator_tag
209 X1 = output_iterator_tag
212 2. X is convertible to TraversalCategory
218 <hr class=
"footer" />
219 <a class=
"reference external" href=
"iterator_archetypes.rst">View document source
</a>.
220 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.