|
|
@ -77,63 +77,62 @@ by adapting other iterators.</td>
|
|
|
|
<li><a class="reference" href="#iterator-facade-lib-iterator-facade" id="id27" name="id27">Iterator facade [lib.iterator.facade]</a><ul>
|
|
|
|
<li><a class="reference" href="#iterator-facade-lib-iterator-facade" id="id27" name="id27">Iterator facade [lib.iterator.facade]</a><ul>
|
|
|
|
<li><a class="reference" href="#class-template-iterator-facade" id="id28" name="id28">Class template <tt class="literal"><span class="pre">iterator_facade</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-iterator-facade" id="id28" name="id28">Class template <tt class="literal"><span class="pre">iterator_facade</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#iterator-facade-requirements" id="id29" name="id29"><tt class="literal"><span class="pre">iterator_facade</span></tt> Requirements</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-facade-requirements" id="id29" name="id29"><tt class="literal"><span class="pre">iterator_facade</span></tt> Requirements</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-facade-iterator-category" id="id30" name="id30"><tt class="literal"><span class="pre">iterator_facade</span></tt> iterator category</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-facade-operations" id="id30" name="id30"><tt class="literal"><span class="pre">iterator_facade</span></tt> operations</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-facade-operations" id="id31" name="id31"><tt class="literal"><span class="pre">iterator_facade</span></tt> operations</a></li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-lib-iterator-adaptor" id="id32" name="id32">Iterator adaptor [lib.iterator.adaptor]</a><ul>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-lib-iterator-adaptor" id="id31" name="id31">Iterator adaptor [lib.iterator.adaptor]</a><ul>
|
|
|
|
<li><a class="reference" href="#class-template-iterator-adaptor" id="id33" name="id33">Class template <tt class="literal"><span class="pre">iterator_adaptor</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-iterator-adaptor" id="id32" name="id32">Class template <tt class="literal"><span class="pre">iterator_adaptor</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-requirements" id="id34" name="id34"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-requirements" id="id33" name="id33"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-base-class-parameters" id="id35" name="id35"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> base class parameters</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-base-class-parameters" id="id34" name="id34"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> base class parameters</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-models" id="id36" name="id36"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-models" id="id35" name="id35"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-public-operations" id="id37" name="id37"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> public operations</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-public-operations" id="id36" name="id36"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> public operations</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-protected-member-functions" id="id38" name="id38"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> protected member functions</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-protected-member-functions" id="id37" name="id37"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> protected member functions</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-private-member-functions" id="id39" name="id39"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> private member functions</a></li>
|
|
|
|
<li><a class="reference" href="#iterator-adaptor-private-member-functions" id="id38" name="id38"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> private member functions</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li><a class="reference" href="#specialized-adaptors-lib-iterator-special-adaptors" id="id40" name="id40">Specialized adaptors [lib.iterator.special.adaptors]</a><ul>
|
|
|
|
<li><a class="reference" href="#specialized-adaptors-lib-iterator-special-adaptors" id="id39" name="id39">Specialized adaptors [lib.iterator.special.adaptors]</a><ul>
|
|
|
|
<li><a class="reference" href="#indirect-iterator" id="id41" name="id41">Indirect iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#indirect-iterator" id="id40" name="id40">Indirect iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#class-template-pointee" id="id42" name="id42">Class template <tt class="literal"><span class="pre">pointee</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-pointee" id="id41" name="id41">Class template <tt class="literal"><span class="pre">pointee</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-indirect-reference" id="id43" name="id43">Class template <tt class="literal"><span class="pre">indirect_reference</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-indirect-reference" id="id42" name="id42">Class template <tt class="literal"><span class="pre">indirect_reference</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-indirect-iterator" id="id44" name="id44">Class template <tt class="literal"><span class="pre">indirect_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-indirect-iterator" id="id43" name="id43">Class template <tt class="literal"><span class="pre">indirect_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#indirect-iterator-requirements" id="id45" name="id45"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#indirect-iterator-requirements" id="id44" name="id44"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#indirect-iterator-models" id="id46" name="id46"><tt class="literal"><span class="pre">indirect_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#indirect-iterator-models" id="id45" name="id45"><tt class="literal"><span class="pre">indirect_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#indirect-iterator-operations" id="id47" name="id47"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></li>
|
|
|
|
<li><a class="reference" href="#indirect-iterator-operations" id="id46" name="id46"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li><a class="reference" href="#reverse-iterator" id="id48" name="id48">Reverse iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#reverse-iterator" id="id47" name="id47">Reverse iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#class-template-reverse-iterator" id="id49" name="id49">Class template <tt class="literal"><span class="pre">reverse_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-reverse-iterator" id="id48" name="id48">Class template <tt class="literal"><span class="pre">reverse_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#reverse-iterator-requirements" id="id50" name="id50"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#reverse-iterator-requirements" id="id49" name="id49"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#reverse-iterator-models" id="id51" name="id51"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#reverse-iterator-models" id="id50" name="id50"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#reverse-iterator-operations" id="id52" name="id52"><tt class="literal"><span class="pre">reverse_iterator</span></tt> operations</a></li>
|
|
|
|
<li><a class="reference" href="#reverse-iterator-operations" id="id51" name="id51"><tt class="literal"><span class="pre">reverse_iterator</span></tt> operations</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li><a class="reference" href="#transform-iterator" id="id53" name="id53">Transform iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#transform-iterator" id="id52" name="id52">Transform iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#class-template-transform-iterator" id="id54" name="id54">Class template <tt class="literal"><span class="pre">transform_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-transform-iterator" id="id53" name="id53">Class template <tt class="literal"><span class="pre">transform_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#transform-iterator-requirements" id="id55" name="id55"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#transform-iterator-requirements" id="id54" name="id54"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#transform-iterator-models" id="id56" name="id56"><tt class="literal"><span class="pre">transform_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#transform-iterator-models" id="id55" name="id55"><tt class="literal"><span class="pre">transform_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#transform-iterator-operations" id="id57" name="id57"><tt class="literal"><span class="pre">transform_iterator</span></tt> operations</a></li>
|
|
|
|
<li><a class="reference" href="#transform-iterator-operations" id="id56" name="id56"><tt class="literal"><span class="pre">transform_iterator</span></tt> operations</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li><a class="reference" href="#filter-iterator" id="id58" name="id58">Filter iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#filter-iterator" id="id57" name="id57">Filter iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#class-template-filter-iterator" id="id59" name="id59">Class template <tt class="literal"><span class="pre">filter_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-filter-iterator" id="id58" name="id58">Class template <tt class="literal"><span class="pre">filter_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#filter-iterator-requirements" id="id60" name="id60"><tt class="literal"><span class="pre">filter_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#filter-iterator-requirements" id="id59" name="id59"><tt class="literal"><span class="pre">filter_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#filter-iterator-models" id="id61" name="id61"><tt class="literal"><span class="pre">filter_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#filter-iterator-models" id="id60" name="id60"><tt class="literal"><span class="pre">filter_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#filter-iterator-operations" id="id62" name="id62"><tt class="literal"><span class="pre">filter_iterator</span></tt> operations</a></li>
|
|
|
|
<li><a class="reference" href="#filter-iterator-operations" id="id61" name="id61"><tt class="literal"><span class="pre">filter_iterator</span></tt> operations</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li><a class="reference" href="#counting-iterator" id="id63" name="id63">Counting iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#counting-iterator" id="id62" name="id62">Counting iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#class-template-counting-iterator" id="id64" name="id64">Class template <tt class="literal"><span class="pre">counting_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-counting-iterator" id="id63" name="id63">Class template <tt class="literal"><span class="pre">counting_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#counting-iterator-requirements" id="id65" name="id65"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#counting-iterator-requirements" id="id64" name="id64"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#counting-iterator-models" id="id66" name="id66"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#counting-iterator-models" id="id65" name="id65"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#counting-iterator-operations" id="id67" name="id67"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></li>
|
|
|
|
<li><a class="reference" href="#counting-iterator-operations" id="id66" name="id66"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li><a class="reference" href="#function-output-iterator" id="id68" name="id68">Function output iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#function-output-iterator" id="id67" name="id67">Function output iterator</a><ul>
|
|
|
|
<li><a class="reference" href="#class-template-function-output-iterator" id="id69" name="id69">Class template <tt class="literal"><span class="pre">function_output_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#class-template-function-output-iterator" id="id68" name="id68">Class template <tt class="literal"><span class="pre">function_output_iterator</span></tt></a></li>
|
|
|
|
<li><a class="reference" href="#function-output-iterator-requirements" id="id70" name="id70"><tt class="literal"><span class="pre">function_output_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#function-output-iterator-requirements" id="id69" name="id69"><tt class="literal"><span class="pre">function_output_iterator</span></tt> requirements</a></li>
|
|
|
|
<li><a class="reference" href="#function-output-iterator-models" id="id71" name="id71"><tt class="literal"><span class="pre">function_output_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#function-output-iterator-models" id="id70" name="id70"><tt class="literal"><span class="pre">function_output_iterator</span></tt> models</a></li>
|
|
|
|
<li><a class="reference" href="#function-output-iterator-operations" id="id72" name="id72"><tt class="literal"><span class="pre">function_output_iterator</span></tt> operations</a></li>
|
|
|
|
<li><a class="reference" href="#function-output-iterator-operations" id="id71" name="id71"><tt class="literal"><span class="pre">function_output_iterator</span></tt> operations</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
@ -625,7 +624,7 @@ public:
|
|
|
|
typedef Reference reference;
|
|
|
|
typedef Reference reference;
|
|
|
|
typedef Value* pointer;
|
|
|
|
typedef Value* pointer;
|
|
|
|
typedef Difference difference_type;
|
|
|
|
typedef Difference difference_type;
|
|
|
|
typedef /* see <a class="reference" href="#facade-iterator-category">below</a> */ iterator_category;
|
|
|
|
typedef /* see <a class="reference" href="#iterator-category">below</a> */ iterator_category;
|
|
|
|
|
|
|
|
|
|
|
|
reference operator*() const;
|
|
|
|
reference operator*() const;
|
|
|
|
/* see <a class="reference" href="#operator-arrow">below</a> */ operator->() const;
|
|
|
|
/* see <a class="reference" href="#operator-arrow">below</a> */ operator->() const;
|
|
|
@ -694,6 +693,39 @@ template <class Derived, class V, class TC, class R, class D>
|
|
|
|
Derived operator+ (iterator_facade<Derived, V, TC, R, D> const&,
|
|
|
|
Derived operator+ (iterator_facade<Derived, V, TC, R, D> const&,
|
|
|
|
typename Derived::difference_type n)
|
|
|
|
typename Derived::difference_type n)
|
|
|
|
</pre>
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<a class="target" id="iterator-category" name="iterator-category"></a><p>The <tt class="literal"><span class="pre">iterator_category</span></tt> member of <tt class="literal"><span class="pre">iterator_facade</span></tt> is
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">facade_iterator_category(CategoryOrTraversal,</span> <span class="pre">value_type,</span>
|
|
|
|
|
|
|
|
<span class="pre">reference)</span></tt>, as specified by the following pseudo-code:</p>
|
|
|
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
|
|
|
facade_iterator_category(C, V, R) =
|
|
|
|
|
|
|
|
if (C is convertible to input_iterator_tag or output_iterator_tag) then
|
|
|
|
|
|
|
|
return C
|
|
|
|
|
|
|
|
else if (C is convertible to incrementable_traversal_tag) then
|
|
|
|
|
|
|
|
if (R is a reference type
|
|
|
|
|
|
|
|
and C is convertible to forward_traversal_tag) then
|
|
|
|
|
|
|
|
if (C is convertible to random_access_traversal_tag)
|
|
|
|
|
|
|
|
return a type convertible to random_access_iterator_tag
|
|
|
|
|
|
|
|
else if (C is convertible to bidirectional_traversal_tag)
|
|
|
|
|
|
|
|
return a type convertible to bidirectional_iterator_tag
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return a type convertible to forward_iterator_tag
|
|
|
|
|
|
|
|
else if (C is convertible to single_pass_traversal_tag
|
|
|
|
|
|
|
|
and R is convertible to V)
|
|
|
|
|
|
|
|
return a type convertible to input_iterator_tag
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return C
|
|
|
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<!-- Copyright David Abrahams 2004. Use, modification and distribution is -->
|
|
|
|
|
|
|
|
<!-- subject to the Boost Software License, Version 1.0. (See accompanying -->
|
|
|
|
|
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
|
|
|
|
|
<p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is <tt class="literal"><span class="pre">use_default</span></tt> then
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">iterator_traversal<Derived>::type</span></tt> is convertible to the most
|
|
|
|
|
|
|
|
derived standard traversal tag type to which
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">iterator_traversal<Iterator>::type</span></tt> is also convertible, and not to
|
|
|
|
|
|
|
|
any more-derived traversal tag type. Otherwise
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">iterator_traversal<Derived>::type</span></tt> is convertible to the most
|
|
|
|
|
|
|
|
derived standard traversal tag type to which <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>
|
|
|
|
|
|
|
|
is also convertible, and not to any more-derived traversal tag type.</p>
|
|
|
|
<p>The <tt class="literal"><span class="pre">enable_if_interoperable</span></tt> template used above is for exposition
|
|
|
|
<p>The <tt class="literal"><span class="pre">enable_if_interoperable</span></tt> template used above is for exposition
|
|
|
|
purposes. The member operators should be only be in an overload set
|
|
|
|
purposes. The member operators should be only be in an overload set
|
|
|
|
provided the derived types <tt class="literal"><span class="pre">Dr1</span></tt> and <tt class="literal"><span class="pre">Dr2</span></tt> are interoperable,
|
|
|
|
provided the derived types <tt class="literal"><span class="pre">Dr1</span></tt> and <tt class="literal"><span class="pre">Dr2</span></tt> are interoperable,
|
|
|
@ -758,8 +790,7 @@ Iterator</td>
|
|
|
|
<tr><td><tt class="literal"><span class="pre">c.equal(y)</span></tt></td>
|
|
|
|
<tr><td><tt class="literal"><span class="pre">c.equal(y)</span></tt></td>
|
|
|
|
<td>convertible to bool</td>
|
|
|
|
<td>convertible to bool</td>
|
|
|
|
<td>true iff <tt class="literal"><span class="pre">c</span></tt> and <tt class="literal"><span class="pre">y</span></tt> refer to the
|
|
|
|
<td>true iff <tt class="literal"><span class="pre">c</span></tt> and <tt class="literal"><span class="pre">y</span></tt> refer to the
|
|
|
|
same position. Implements <tt class="literal"><span class="pre">c</span> <span class="pre">==</span> <span class="pre">y</span></tt>
|
|
|
|
same position.</td>
|
|
|
|
and <tt class="literal"><span class="pre">c</span> <span class="pre">!=</span> <span class="pre">y</span></tt>.</td>
|
|
|
|
|
|
|
|
<td>Single Pass Iterator</td>
|
|
|
|
<td>Single Pass Iterator</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr><td><tt class="literal"><span class="pre">a.increment()</span></tt></td>
|
|
|
|
<tr><td><tt class="literal"><span class="pre">a.increment()</span></tt></td>
|
|
|
@ -779,77 +810,19 @@ Iterator</td>
|
|
|
|
<td>Random Access Traversal
|
|
|
|
<td>Random Access Traversal
|
|
|
|
Iterator</td>
|
|
|
|
Iterator</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr><td><tt class="literal"><span class="pre">c.distance_to(b)</span></tt></td>
|
|
|
|
|
|
|
|
<td>convertible to
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">F::difference_type</span></tt></td>
|
|
|
|
|
|
|
|
<td>equivalent to <tt class="literal"><span class="pre">distance(c,</span> <span class="pre">b)</span></tt></td>
|
|
|
|
|
|
|
|
<td>Random Access Traversal
|
|
|
|
|
|
|
|
Iterator</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr><td><tt class="literal"><span class="pre">c.distance_to(z)</span></tt></td>
|
|
|
|
<tr><td><tt class="literal"><span class="pre">c.distance_to(z)</span></tt></td>
|
|
|
|
<td>convertible to
|
|
|
|
<td>convertible to
|
|
|
|
<tt class="literal"><span class="pre">F::difference_type</span></tt></td>
|
|
|
|
<tt class="literal"><span class="pre">F::difference_type</span></tt></td>
|
|
|
|
<td>equivalent to <tt class="literal"><span class="pre">distance(c,</span> <span class="pre">z)</span></tt>.
|
|
|
|
<td>equivalent to <tt class="literal"><span class="pre">distance(c,</span> <span class="pre">X(z))</span></tt>.</td>
|
|
|
|
Implements <tt class="literal"><span class="pre">c</span> <span class="pre">-</span> <span class="pre">z</span></tt>, <tt class="literal"><span class="pre">c</span> <span class="pre"><</span> <span class="pre">z</span></tt>, <tt class="literal"><span class="pre">c</span>
|
|
|
|
|
|
|
|
<span class="pre"><=</span> <span class="pre">z</span></tt>, <tt class="literal"><span class="pre">c</span> <span class="pre">></span> <span class="pre">z</span></tt>, and <tt class="literal"><span class="pre">c</span> <span class="pre">>=</span> <span class="pre">c</span></tt>.</td>
|
|
|
|
|
|
|
|
<td>Random Access Traversal
|
|
|
|
<td>Random Access Traversal
|
|
|
|
Iterator</td>
|
|
|
|
Iterator</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<a class="target" id="facade-iterator-category" name="facade-iterator-category"></a></div>
|
|
|
|
|
|
|
|
<div class="section" id="iterator-facade-iterator-category">
|
|
|
|
|
|
|
|
<h3><a class="toc-backref" href="#id30" name="iterator-facade-iterator-category"><tt class="literal"><span class="pre">iterator_facade</span></tt> iterator category</a></h3>
|
|
|
|
|
|
|
|
<p>The <tt class="literal"><span class="pre">iterator_category</span></tt> member of <tt class="literal"><span class="pre">iterator_facade<X,V,R,C,D></span></tt>
|
|
|
|
|
|
|
|
satisfies the following conditions:</p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li><p class="first">if <tt class="literal"><span class="pre">C</span></tt> is convertible to <tt class="literal"><span class="pre">std::input_iterator_tag</span></tt> or
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">C</span></tt> is convertible to <tt class="literal"><span class="pre">std::output_iterator_tag</span></tt>,
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">iterator_category</span></tt> is the same as <tt class="literal"><span class="pre">C</span></tt>.</p>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li><p class="first">Otherwise, if <tt class="literal"><span class="pre">C</span></tt> is not convertible to
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">incrementable_traversal_tag</span></tt>, the program is ill-formed</p>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li><p class="first">Otherwise:</p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li><p class="first"><tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to the iterator
|
|
|
|
|
|
|
|
category tag or tags given by the following algorithm, and
|
|
|
|
|
|
|
|
not to any more-derived iterator category tag or tags:</p>
|
|
|
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
|
|
|
if (R is a reference type
|
|
|
|
|
|
|
|
&& C is convertible to forward_traversal_tag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (C is convertible to random_access_traversal_tag)
|
|
|
|
|
|
|
|
random_access_iterator_tag
|
|
|
|
|
|
|
|
else if (C is convertible to bidirectional_traversal_tag)
|
|
|
|
|
|
|
|
bidirectional_iterator_tag
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
forward_iterator_tag
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (C is convertible to single_pass_traversal_tag
|
|
|
|
|
|
|
|
&& R is convertible to V)
|
|
|
|
|
|
|
|
input_iterator_tag
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
C
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li><p class="first"><tt class="literal"><span class="pre">iterator_traversal<X>::type</span></tt> is convertible to the most
|
|
|
|
|
|
|
|
derived traversal tag type to which <tt class="literal"><span class="pre">C</span></tt> is also
|
|
|
|
|
|
|
|
convertible, and not to any more-derived traversal tag type.</p>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<!-- Copyright David Abrahams 2004. Use, modification and distribution is -->
|
|
|
|
|
|
|
|
<!-- subject to the Boost Software License, Version 1.0. (See accompanying -->
|
|
|
|
|
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="iterator-facade-operations">
|
|
|
|
<div class="section" id="iterator-facade-operations">
|
|
|
|
<h3><a class="toc-backref" href="#id31" name="iterator-facade-operations"><tt class="literal"><span class="pre">iterator_facade</span></tt> operations</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id30" name="iterator-facade-operations"><tt class="literal"><span class="pre">iterator_facade</span></tt> operations</a></h3>
|
|
|
|
<p>The operations in this section are described in terms of operations on
|
|
|
|
<p>The operations in this section are described in terms of operations on
|
|
|
|
the core interface of <tt class="literal"><span class="pre">Derived</span></tt> which may be inaccessible
|
|
|
|
the core interface of <tt class="literal"><span class="pre">Derived</span></tt> which may be inaccessible
|
|
|
|
(i.e. private). The implementation should access these operations
|
|
|
|
(i.e. private). The implementation should access these operations
|
|
|
@ -887,11 +860,10 @@ of type <tt class="literal"><span class="pre">pointer</span></tt> equal to:</p>
|
|
|
|
<tbody valign="top">
|
|
|
|
<tbody valign="top">
|
|
|
|
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">an object convertible to <tt class="literal"><span class="pre">value_type</span></tt>. For constant
|
|
|
|
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">an object convertible to <tt class="literal"><span class="pre">value_type</span></tt>. For constant
|
|
|
|
objects <tt class="literal"><span class="pre">v</span></tt> of type <tt class="literal"><span class="pre">value_type</span></tt>, and <tt class="literal"><span class="pre">n</span></tt> of type
|
|
|
|
objects <tt class="literal"><span class="pre">v</span></tt> of type <tt class="literal"><span class="pre">value_type</span></tt>, and <tt class="literal"><span class="pre">n</span></tt> of type
|
|
|
|
<tt class="literal"><span class="pre">difference_type</span></tt>, and reference <tt class="literal"><span class="pre">p</span></tt> equal to
|
|
|
|
<tt class="literal"><span class="pre">difference_type</span></tt>, <tt class="literal"><span class="pre">(*this)[n]</span> <span class="pre">=</span> <span class="pre">v</span></tt> is equivalent to
|
|
|
|
<tt class="literal"><span class="pre">*static_cast<Derived</span> <span class="pre">const*>(this)</span></tt>, <tt class="literal"><span class="pre">(*this)[n]</span> <span class="pre">=</span> <span class="pre">v</span></tt> is
|
|
|
|
<tt class="literal"><span class="pre">*(*this</span> <span class="pre">+</span> <span class="pre">n)</span> <span class="pre">=</span> <span class="pre">v</span></tt>, and <tt class="literal"><span class="pre">static_cast<value_type</span>
|
|
|
|
equivalent to <tt class="literal"><span class="pre">*(p+</span> <span class="pre">n)</span> <span class="pre">=</span> <span class="pre">v</span></tt>, and <tt class="literal"><span class="pre">static_cast<value_type</span>
|
|
|
|
|
|
|
|
<span class="pre">const&>((*this)[n])</span></tt> is equivalent to
|
|
|
|
<span class="pre">const&>((*this)[n])</span></tt> is equivalent to
|
|
|
|
<tt class="literal"><span class="pre">static_cast<value_type</span> <span class="pre">const&>(*(p+n))</span></tt></td>
|
|
|
|
<tt class="literal"><span class="pre">static_cast<value_type</span> <span class="pre">const&>(*(*this</span> <span class="pre">+</span> <span class="pre">n))</span></tt></td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</table>
|
|
|
@ -991,7 +963,7 @@ return tmp -= n;
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="iterator-adaptor-lib-iterator-adaptor">
|
|
|
|
<div class="section" id="iterator-adaptor-lib-iterator-adaptor">
|
|
|
|
<h2><a class="toc-backref" href="#id32" name="iterator-adaptor-lib-iterator-adaptor">Iterator adaptor [lib.iterator.adaptor]</a></h2>
|
|
|
|
<h2><a class="toc-backref" href="#id31" name="iterator-adaptor-lib-iterator-adaptor">Iterator adaptor [lib.iterator.adaptor]</a></h2>
|
|
|
|
<!-- Version 1.1 of this ReStructuredText document corresponds to
|
|
|
|
<!-- Version 1.1 of this ReStructuredText document corresponds to
|
|
|
|
n1530_, the paper accepted by the LWG. -->
|
|
|
|
n1530_, the paper accepted by the LWG. -->
|
|
|
|
<!-- Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All
|
|
|
|
<!-- Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All
|
|
|
@ -1007,7 +979,7 @@ depends on the operations supported by the <tt class="literal"><span class="pre"
|
|
|
|
core interface functions of <tt class="literal"><span class="pre">iterator_facade</span></tt> are redefined in the
|
|
|
|
core interface functions of <tt class="literal"><span class="pre">iterator_facade</span></tt> are redefined in the
|
|
|
|
<tt class="literal"><span class="pre">Derived</span></tt> class.</p>
|
|
|
|
<tt class="literal"><span class="pre">Derived</span></tt> class.</p>
|
|
|
|
<div class="section" id="class-template-iterator-adaptor">
|
|
|
|
<div class="section" id="class-template-iterator-adaptor">
|
|
|
|
<h3><a class="toc-backref" href="#id33" name="class-template-iterator-adaptor">Class template <tt class="literal"><span class="pre">iterator_adaptor</span></tt></a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id32" name="class-template-iterator-adaptor">Class template <tt class="literal"><span class="pre">iterator_adaptor</span></tt></a></h3>
|
|
|
|
<!-- Version 1.4 of this ReStructuredText document corresponds to
|
|
|
|
<!-- Version 1.4 of this ReStructuredText document corresponds to
|
|
|
|
n1530_, the paper accepted by the LWG for TR1. -->
|
|
|
|
n1530_, the paper accepted by the LWG for TR1. -->
|
|
|
|
<!-- Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All
|
|
|
|
<!-- Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All
|
|
|
@ -1056,13 +1028,13 @@ class iterator_adaptor
|
|
|
|
</pre>
|
|
|
|
</pre>
|
|
|
|
<a class="target" id="requirements" name="requirements"></a></div>
|
|
|
|
<a class="target" id="requirements" name="requirements"></a></div>
|
|
|
|
<div class="section" id="iterator-adaptor-requirements">
|
|
|
|
<div class="section" id="iterator-adaptor-requirements">
|
|
|
|
<h3><a class="toc-backref" href="#id34" name="iterator-adaptor-requirements"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> requirements</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id33" name="iterator-adaptor-requirements"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> requirements</a></h3>
|
|
|
|
<p>The <tt class="literal"><span class="pre">Derived</span></tt> template argument must be a publicly derived from
|
|
|
|
<p>The <tt class="literal"><span class="pre">Derived</span></tt> template argument must be a publicly derived from
|
|
|
|
<tt class="literal"><span class="pre">iterator_adaptor</span></tt>.</p>
|
|
|
|
<tt class="literal"><span class="pre">iterator_adaptor</span></tt>.</p>
|
|
|
|
<p>The <tt class="literal"><span class="pre">Base</span></tt> argument shall be Assignable and Copy Constructible.</p>
|
|
|
|
<p>The <tt class="literal"><span class="pre">Base</span></tt> argument shall be Assignable and Copy Constructible.</p>
|
|
|
|
<a class="target" id="base-parameters" name="base-parameters"></a></div>
|
|
|
|
<a class="target" id="base-parameters" name="base-parameters"></a></div>
|
|
|
|
<div class="section" id="iterator-adaptor-base-class-parameters">
|
|
|
|
<div class="section" id="iterator-adaptor-base-class-parameters">
|
|
|
|
<h3><a class="toc-backref" href="#id35" name="iterator-adaptor-base-class-parameters"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> base class parameters</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id34" name="iterator-adaptor-base-class-parameters"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> base class parameters</a></h3>
|
|
|
|
<p>The <em>V</em>, <em>C</em>, <em>R</em>, and <em>D</em> parameters of the <tt class="literal"><span class="pre">iterator_facade</span></tt>
|
|
|
|
<p>The <em>V</em>, <em>C</em>, <em>R</em>, and <em>D</em> parameters of the <tt class="literal"><span class="pre">iterator_facade</span></tt>
|
|
|
|
used as a base class in the summary of <tt class="literal"><span class="pre">iterator_adaptor</span></tt>
|
|
|
|
used as a base class in the summary of <tt class="literal"><span class="pre">iterator_adaptor</span></tt>
|
|
|
|
above are defined as follows:</p>
|
|
|
|
above are defined as follows:</p>
|
|
|
@ -1092,7 +1064,7 @@ above are defined as follows:</p>
|
|
|
|
</pre>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="iterator-adaptor-models">
|
|
|
|
<div class="section" id="iterator-adaptor-models">
|
|
|
|
<h3><a class="toc-backref" href="#id36" name="iterator-adaptor-models"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> models</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id35" name="iterator-adaptor-models"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> models</a></h3>
|
|
|
|
<p>In order for <tt class="literal"><span class="pre">Derived</span></tt> to model the iterator concepts corresponding
|
|
|
|
<p>In order for <tt class="literal"><span class="pre">Derived</span></tt> to model the iterator concepts corresponding
|
|
|
|
to <tt class="literal"><span class="pre">iterator_traits<Derived>::iterator_category</span></tt>, the expressions
|
|
|
|
to <tt class="literal"><span class="pre">iterator_traits<Derived>::iterator_category</span></tt>, the expressions
|
|
|
|
involving <tt class="literal"><span class="pre">m_iterator</span></tt> in the specifications of those private member
|
|
|
|
involving <tt class="literal"><span class="pre">m_iterator</span></tt> in the specifications of those private member
|
|
|
@ -1102,7 +1074,7 @@ expression involving <tt class="literal"><span class="pre">Derived</span></tt> i
|
|
|
|
<!-- The above is confusing and needs a rewrite. -JGS -->
|
|
|
|
<!-- The above is confusing and needs a rewrite. -JGS -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="iterator-adaptor-public-operations">
|
|
|
|
<div class="section" id="iterator-adaptor-public-operations">
|
|
|
|
<h3><a class="toc-backref" href="#id37" name="iterator-adaptor-public-operations"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> public operations</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id36" name="iterator-adaptor-public-operations"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> public operations</a></h3>
|
|
|
|
<p><tt class="literal"><span class="pre">iterator_adaptor();</span></tt></p>
|
|
|
|
<p><tt class="literal"><span class="pre">iterator_adaptor();</span></tt></p>
|
|
|
|
<table class="field-list" frame="void" rules="none">
|
|
|
|
<table class="field-list" frame="void" rules="none">
|
|
|
|
<col class="field-name" />
|
|
|
|
<col class="field-name" />
|
|
|
@ -1136,7 +1108,7 @@ expression involving <tt class="literal"><span class="pre">Derived</span></tt> i
|
|
|
|
</table>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="iterator-adaptor-protected-member-functions">
|
|
|
|
<div class="section" id="iterator-adaptor-protected-member-functions">
|
|
|
|
<h3><a class="toc-backref" href="#id38" name="iterator-adaptor-protected-member-functions"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> protected member functions</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id37" name="iterator-adaptor-protected-member-functions"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> protected member functions</a></h3>
|
|
|
|
<p><tt class="literal"><span class="pre">Base</span> <span class="pre">const&</span> <span class="pre">base_reference()</span> <span class="pre">const;</span></tt></p>
|
|
|
|
<p><tt class="literal"><span class="pre">Base</span> <span class="pre">const&</span> <span class="pre">base_reference()</span> <span class="pre">const;</span></tt></p>
|
|
|
|
<table class="field-list" frame="void" rules="none">
|
|
|
|
<table class="field-list" frame="void" rules="none">
|
|
|
|
<col class="field-name" />
|
|
|
|
<col class="field-name" />
|
|
|
@ -1157,7 +1129,7 @@ expression involving <tt class="literal"><span class="pre">Derived</span></tt> i
|
|
|
|
</table>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="iterator-adaptor-private-member-functions">
|
|
|
|
<div class="section" id="iterator-adaptor-private-member-functions">
|
|
|
|
<h3><a class="toc-backref" href="#id39" name="iterator-adaptor-private-member-functions"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> private member functions</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id38" name="iterator-adaptor-private-member-functions"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> private member functions</a></h3>
|
|
|
|
<p><tt class="literal"><span class="pre">typename</span> <span class="pre">iterator_adaptor::reference</span> <span class="pre">dereference()</span> <span class="pre">const;</span></tt></p>
|
|
|
|
<p><tt class="literal"><span class="pre">typename</span> <span class="pre">iterator_adaptor::reference</span> <span class="pre">dereference()</span> <span class="pre">const;</span></tt></p>
|
|
|
|
<table class="field-list" frame="void" rules="none">
|
|
|
|
<table class="field-list" frame="void" rules="none">
|
|
|
|
<col class="field-name" />
|
|
|
|
<col class="field-name" />
|
|
|
@ -1226,7 +1198,7 @@ typename iterator_adaptor::difference_type distance_to(
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="specialized-adaptors-lib-iterator-special-adaptors">
|
|
|
|
<div class="section" id="specialized-adaptors-lib-iterator-special-adaptors">
|
|
|
|
<h2><a class="toc-backref" href="#id40" name="specialized-adaptors-lib-iterator-special-adaptors">Specialized adaptors [lib.iterator.special.adaptors]</a></h2>
|
|
|
|
<h2><a class="toc-backref" href="#id39" name="specialized-adaptors-lib-iterator-special-adaptors">Specialized adaptors [lib.iterator.special.adaptors]</a></h2>
|
|
|
|
<p>The <tt class="literal"><span class="pre">enable_if_convertible<X,Y>::type</span></tt> expression used in
|
|
|
|
<p>The <tt class="literal"><span class="pre">enable_if_convertible<X,Y>::type</span></tt> expression used in
|
|
|
|
this section is for exposition purposes. The converting constructors
|
|
|
|
this section is for exposition purposes. The converting constructors
|
|
|
|
for specialized adaptors should be only be in an overload set provided
|
|
|
|
for specialized adaptors should be only be in an overload set provided
|
|
|
@ -1255,7 +1227,7 @@ take the constructor out of the overload set when the types are not
|
|
|
|
implicitly convertible.
|
|
|
|
implicitly convertible.
|
|
|
|
]</p>
|
|
|
|
]</p>
|
|
|
|
<div class="section" id="indirect-iterator">
|
|
|
|
<div class="section" id="indirect-iterator">
|
|
|
|
<h3><a class="toc-backref" href="#id41" name="indirect-iterator">Indirect iterator</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id40" name="indirect-iterator">Indirect iterator</a></h3>
|
|
|
|
<p><tt class="literal"><span class="pre">indirect_iterator</span></tt> adapts an iterator by applying an
|
|
|
|
<p><tt class="literal"><span class="pre">indirect_iterator</span></tt> adapts an iterator by applying an
|
|
|
|
<em>extra</em> dereference inside of <tt class="literal"><span class="pre">operator*()</span></tt>. For example, this
|
|
|
|
<em>extra</em> dereference inside of <tt class="literal"><span class="pre">operator*()</span></tt>. For example, this
|
|
|
|
iterator adaptor makes it possible to view a container of pointers
|
|
|
|
iterator adaptor makes it possible to view a container of pointers
|
|
|
@ -1265,7 +1237,7 @@ auxiliary traits, <tt class="literal"><span class="pre">pointee</span></tt> and
|
|
|
|
provide support for underlying iterators whose <tt class="literal"><span class="pre">value_type</span></tt> is
|
|
|
|
provide support for underlying iterators whose <tt class="literal"><span class="pre">value_type</span></tt> is
|
|
|
|
not an iterator.</p>
|
|
|
|
not an iterator.</p>
|
|
|
|
<div class="section" id="class-template-pointee">
|
|
|
|
<div class="section" id="class-template-pointee">
|
|
|
|
<h4><a class="toc-backref" href="#id42" name="class-template-pointee">Class template <tt class="literal"><span class="pre">pointee</span></tt></a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id41" name="class-template-pointee">Class template <tt class="literal"><span class="pre">pointee</span></tt></a></h4>
|
|
|
|
<!-- Copyright David Abrahams 2004. Use, modification and distribution is -->
|
|
|
|
<!-- Copyright David Abrahams 2004. Use, modification and distribution is -->
|
|
|
|
<!-- subject to the Boost Software License, Version 1.0. (See accompanying -->
|
|
|
|
<!-- subject to the Boost Software License, Version 1.0. (See accompanying -->
|
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
@ -1309,7 +1281,7 @@ else
|
|
|
|
</pre>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="class-template-indirect-reference">
|
|
|
|
<div class="section" id="class-template-indirect-reference">
|
|
|
|
<h4><a class="toc-backref" href="#id43" name="class-template-indirect-reference">Class template <tt class="literal"><span class="pre">indirect_reference</span></tt></a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id42" name="class-template-indirect-reference">Class template <tt class="literal"><span class="pre">indirect_reference</span></tt></a></h4>
|
|
|
|
<!-- Copyright David Abrahams 2004. Use, modification and distribution is -->
|
|
|
|
<!-- Copyright David Abrahams 2004. Use, modification and distribution is -->
|
|
|
|
<!-- subject to the Boost Software License, Version 1.0. (See accompanying -->
|
|
|
|
<!-- subject to the Boost Software License, Version 1.0. (See accompanying -->
|
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
@ -1344,7 +1316,7 @@ else
|
|
|
|
</pre>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="class-template-indirect-iterator">
|
|
|
|
<div class="section" id="class-template-indirect-iterator">
|
|
|
|
<h4><a class="toc-backref" href="#id44" name="class-template-indirect-iterator">Class template <tt class="literal"><span class="pre">indirect_iterator</span></tt></a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id43" name="class-template-indirect-iterator">Class template <tt class="literal"><span class="pre">indirect_iterator</span></tt></a></h4>
|
|
|
|
<pre class="literal-block">
|
|
|
|
<pre class="literal-block">
|
|
|
|
template <
|
|
|
|
template <
|
|
|
|
class Iterator
|
|
|
|
class Iterator
|
|
|
@ -1411,60 +1383,13 @@ if (Difference is use_default)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
typedef Difference difference_type;
|
|
|
|
typedef Difference difference_type;
|
|
|
|
</pre>
|
|
|
|
</pre>
|
|
|
|
<p><tt class="literal"><span class="pre">iterator_category</span></tt> satisfies the following conditions, where
|
|
|
|
<p>The <tt class="literal"><span class="pre">iterator_category</span></tt> member is <tt class="literal"><span class="pre">facade_iterator_category(C,</span>
|
|
|
|
<tt class="literal"><span class="pre">R</span></tt> is <tt class="literal"><span class="pre">reference</span></tt> and <tt class="literal"><span class="pre">V</span></tt> is <tt class="literal"><span class="pre">value_type</span></tt>, and where: if
|
|
|
|
<span class="pre">value_type,</span> <span class="pre">reference)</span></tt> where if <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is
|
|
|
|
<tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is <tt class="literal"><span class="pre">use_default</span></tt>, <tt class="literal"><span class="pre">C</span></tt> is
|
|
|
|
<tt class="literal"><span class="pre">use_default</span></tt>, <tt class="literal"><span class="pre">C</span></tt> is <tt class="literal"><span class="pre">iterator_traversal<Iterator>::type</span></tt> and
|
|
|
|
<tt class="literal"><span class="pre">iterator_traversal<Iterator>::type</span></tt> and otherwise <tt class="literal"><span class="pre">C</span></tt> is
|
|
|
|
otherwise <tt class="literal"><span class="pre">C</span></tt> is <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>.</p>
|
|
|
|
<tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>.</p>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li><p class="first">if <tt class="literal"><span class="pre">C</span></tt> is convertible to <tt class="literal"><span class="pre">std::input_iterator_tag</span></tt> or
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">C</span></tt> is convertible to <tt class="literal"><span class="pre">std::output_iterator_tag</span></tt>,
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">iterator_category</span></tt> is the same as <tt class="literal"><span class="pre">C</span></tt>.</p>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li><p class="first">Otherwise, if <tt class="literal"><span class="pre">C</span></tt> is not convertible to
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">incrementable_traversal_tag</span></tt>, the program is ill-formed</p>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li><p class="first">Otherwise:</p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li><p class="first"><tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to the iterator
|
|
|
|
|
|
|
|
category tag or tags given by the following algorithm, and
|
|
|
|
|
|
|
|
not to any more-derived iterator category tag or tags:</p>
|
|
|
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
|
|
|
if (R is a reference type
|
|
|
|
|
|
|
|
&& C is convertible to forward_traversal_tag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (C is convertible to random_access_traversal_tag)
|
|
|
|
|
|
|
|
random_access_iterator_tag
|
|
|
|
|
|
|
|
else if (C is convertible to bidirectional_traversal_tag)
|
|
|
|
|
|
|
|
bidirectional_iterator_tag
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
forward_iterator_tag
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (C is convertible to single_pass_traversal_tag
|
|
|
|
|
|
|
|
&& R is convertible to V)
|
|
|
|
|
|
|
|
input_iterator_tag
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
C
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li><p class="first"><tt class="literal"><span class="pre">iterator_traversal<X>::type</span></tt> is convertible to the most
|
|
|
|
|
|
|
|
derived traversal tag type to which <tt class="literal"><span class="pre">C</span></tt> is also
|
|
|
|
|
|
|
|
convertible, and not to any more-derived traversal tag type.</p>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<!-- Copyright David Abrahams 2004. Use, modification and distribution is -->
|
|
|
|
|
|
|
|
<!-- subject to the Boost Software License, Version 1.0. (See accompanying -->
|
|
|
|
|
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
|
|
|
|
|
</blockquote>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="indirect-iterator-requirements">
|
|
|
|
<div class="section" id="indirect-iterator-requirements">
|
|
|
|
<h4><a class="toc-backref" href="#id45" name="indirect-iterator-requirements"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id44" name="indirect-iterator-requirements"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></h4>
|
|
|
|
<p>The expression <tt class="literal"><span class="pre">*v</span></tt>, where <tt class="literal"><span class="pre">v</span></tt> is an object of
|
|
|
|
<p>The expression <tt class="literal"><span class="pre">*v</span></tt>, where <tt class="literal"><span class="pre">v</span></tt> is an object of
|
|
|
|
<tt class="literal"><span class="pre">iterator_traits<Iterator>::value_type</span></tt>, shall be valid
|
|
|
|
<tt class="literal"><span class="pre">iterator_traits<Iterator>::value_type</span></tt>, shall be valid
|
|
|
|
expression and convertible to <tt class="literal"><span class="pre">reference</span></tt>. <tt class="literal"><span class="pre">Iterator</span></tt> shall
|
|
|
|
expression and convertible to <tt class="literal"><span class="pre">reference</span></tt>. <tt class="literal"><span class="pre">Iterator</span></tt> shall
|
|
|
@ -1478,7 +1403,7 @@ parameter is not <tt class="literal"><span class="pre">use_default</span></tt>,
|
|
|
|
deducing the default for the <tt class="literal"><span class="pre">value_type</span></tt> member.]</p>
|
|
|
|
deducing the default for the <tt class="literal"><span class="pre">value_type</span></tt> member.]</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="indirect-iterator-models">
|
|
|
|
<div class="section" id="indirect-iterator-models">
|
|
|
|
<h4><a class="toc-backref" href="#id46" name="indirect-iterator-models"><tt class="literal"><span class="pre">indirect_iterator</span></tt> models</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id45" name="indirect-iterator-models"><tt class="literal"><span class="pre">indirect_iterator</span></tt> models</a></h4>
|
|
|
|
<p>In addition to the concepts indicated by <tt class="literal"><span class="pre">iterator_category</span></tt>
|
|
|
|
<p>In addition to the concepts indicated by <tt class="literal"><span class="pre">iterator_category</span></tt>
|
|
|
|
and by <tt class="literal"><span class="pre">iterator_traversal<indirect_iterator>::type</span></tt>, a
|
|
|
|
and by <tt class="literal"><span class="pre">iterator_traversal<indirect_iterator>::type</span></tt>, a
|
|
|
|
specialization of <tt class="literal"><span class="pre">indirect_iterator</span></tt> models the following
|
|
|
|
specialization of <tt class="literal"><span class="pre">indirect_iterator</span></tt> models the following
|
|
|
@ -1499,7 +1424,7 @@ expression (where <tt class="literal"><span class="pre">t</span></tt> is an obje
|
|
|
|
interoperable with iterator <tt class="literal"><span class="pre">Y</span></tt>.</p>
|
|
|
|
interoperable with iterator <tt class="literal"><span class="pre">Y</span></tt>.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="indirect-iterator-operations">
|
|
|
|
<div class="section" id="indirect-iterator-operations">
|
|
|
|
<h4><a class="toc-backref" href="#id47" name="indirect-iterator-operations"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id46" name="indirect-iterator-operations"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></h4>
|
|
|
|
<p>In addition to the operations required by the concepts described
|
|
|
|
<p>In addition to the operations required by the concepts described
|
|
|
|
above, specializations of <tt class="literal"><span class="pre">indirect_iterator</span></tt> provide the
|
|
|
|
above, specializations of <tt class="literal"><span class="pre">indirect_iterator</span></tt> provide the
|
|
|
|
following operations.</p>
|
|
|
|
following operations.</p>
|
|
|
@ -1591,11 +1516,11 @@ indirect_iterator(
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="reverse-iterator">
|
|
|
|
<div class="section" id="reverse-iterator">
|
|
|
|
<h3><a class="toc-backref" href="#id48" name="reverse-iterator">Reverse iterator</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id47" name="reverse-iterator">Reverse iterator</a></h3>
|
|
|
|
<p>The reverse iterator adaptor iterates through the adapted iterator
|
|
|
|
<p>The reverse iterator adaptor iterates through the adapted iterator
|
|
|
|
range in the opposite direction.</p>
|
|
|
|
range in the opposite direction.</p>
|
|
|
|
<div class="section" id="class-template-reverse-iterator">
|
|
|
|
<div class="section" id="class-template-reverse-iterator">
|
|
|
|
<h4><a class="toc-backref" href="#id49" name="class-template-reverse-iterator">Class template <tt class="literal"><span class="pre">reverse_iterator</span></tt></a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id48" name="class-template-reverse-iterator">Class template <tt class="literal"><span class="pre">reverse_iterator</span></tt></a></h4>
|
|
|
|
<pre class="literal-block">
|
|
|
|
<pre class="literal-block">
|
|
|
|
template <class Iterator>
|
|
|
|
template <class Iterator>
|
|
|
|
class reverse_iterator
|
|
|
|
class reverse_iterator
|
|
|
@ -1632,11 +1557,11 @@ Lvalue Iterator, then <tt class="literal"><span class="pre">iterator_category</s
|
|
|
|
convertible to <tt class="literal"><span class="pre">input_iterator_tag</span></tt>.</p>
|
|
|
|
convertible to <tt class="literal"><span class="pre">input_iterator_tag</span></tt>.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="reverse-iterator-requirements">
|
|
|
|
<div class="section" id="reverse-iterator-requirements">
|
|
|
|
<h4><a class="toc-backref" href="#id50" name="reverse-iterator-requirements"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id49" name="reverse-iterator-requirements"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></h4>
|
|
|
|
<p><tt class="literal"><span class="pre">Iterator</span></tt> must be a model of Bidirectional Traversal Iterator.</p>
|
|
|
|
<p><tt class="literal"><span class="pre">Iterator</span></tt> must be a model of Bidirectional Traversal Iterator.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="reverse-iterator-models">
|
|
|
|
<div class="section" id="reverse-iterator-models">
|
|
|
|
<h4><a class="toc-backref" href="#id51" name="reverse-iterator-models"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id50" name="reverse-iterator-models"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></h4>
|
|
|
|
<p>A specialization of <tt class="literal"><span class="pre">reverse_iterator</span></tt> models the same standard
|
|
|
|
<p>A specialization of <tt class="literal"><span class="pre">reverse_iterator</span></tt> models the same standard
|
|
|
|
traversal and access iterator concepts modeled by its <tt class="literal"><span class="pre">Iterator</span></tt>
|
|
|
|
traversal and access iterator concepts modeled by its <tt class="literal"><span class="pre">Iterator</span></tt>
|
|
|
|
argument. In addition, it models the old iterator concepts
|
|
|
|
argument. In addition, it models the old iterator concepts
|
|
|
@ -1674,7 +1599,7 @@ Random Access Traversal Iterator</td>
|
|
|
|
if and only if iterator <tt class="literal"><span class="pre">X</span></tt> is interoperable with iterator <tt class="literal"><span class="pre">Y</span></tt>.</p>
|
|
|
|
if and only if iterator <tt class="literal"><span class="pre">X</span></tt> is interoperable with iterator <tt class="literal"><span class="pre">Y</span></tt>.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="reverse-iterator-operations">
|
|
|
|
<div class="section" id="reverse-iterator-operations">
|
|
|
|
<h4><a class="toc-backref" href="#id52" name="reverse-iterator-operations"><tt class="literal"><span class="pre">reverse_iterator</span></tt> operations</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id51" name="reverse-iterator-operations"><tt class="literal"><span class="pre">reverse_iterator</span></tt> operations</a></h4>
|
|
|
|
<p>In addition to the operations required by the concepts modeled by
|
|
|
|
<p>In addition to the operations required by the concepts modeled by
|
|
|
|
<tt class="literal"><span class="pre">reverse_iterator</span></tt>, <tt class="literal"><span class="pre">reverse_iterator</span></tt> provides the following
|
|
|
|
<tt class="literal"><span class="pre">reverse_iterator</span></tt>, <tt class="literal"><span class="pre">reverse_iterator</span></tt> provides the following
|
|
|
|
operations.</p>
|
|
|
|
operations.</p>
|
|
|
@ -1764,12 +1689,12 @@ return *--tmp;
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="transform-iterator">
|
|
|
|
<div class="section" id="transform-iterator">
|
|
|
|
<h3><a class="toc-backref" href="#id53" name="transform-iterator">Transform iterator</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id52" name="transform-iterator">Transform iterator</a></h3>
|
|
|
|
<p>The transform iterator adapts an iterator by modifying the
|
|
|
|
<p>The transform iterator adapts an iterator by modifying the
|
|
|
|
<tt class="literal"><span class="pre">operator*</span></tt> to apply a function object to the result of
|
|
|
|
<tt class="literal"><span class="pre">operator*</span></tt> to apply a function object to the result of
|
|
|
|
dereferencing the iterator and returning the result.</p>
|
|
|
|
dereferencing the iterator and returning the result.</p>
|
|
|
|
<div class="section" id="class-template-transform-iterator">
|
|
|
|
<div class="section" id="class-template-transform-iterator">
|
|
|
|
<h4><a class="toc-backref" href="#id54" name="class-template-transform-iterator">Class template <tt class="literal"><span class="pre">transform_iterator</span></tt></a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id53" name="class-template-transform-iterator">Class template <tt class="literal"><span class="pre">transform_iterator</span></tt></a></h4>
|
|
|
|
<!-- Version 1.3 of this document was accepted for TR1 -->
|
|
|
|
<!-- Version 1.3 of this document was accepted for TR1 -->
|
|
|
|
<pre class="literal-block">
|
|
|
|
<pre class="literal-block">
|
|
|
|
template <class UnaryFunction,
|
|
|
|
template <class UnaryFunction,
|
|
|
@ -1822,7 +1747,7 @@ model Readable Lvalue Iterator then <tt class="literal"><span class="pre">iterat
|
|
|
|
convertible to <tt class="literal"><span class="pre">input_iterator_tag</span></tt>.</p>
|
|
|
|
convertible to <tt class="literal"><span class="pre">input_iterator_tag</span></tt>.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="transform-iterator-requirements">
|
|
|
|
<div class="section" id="transform-iterator-requirements">
|
|
|
|
<h4><a class="toc-backref" href="#id55" name="transform-iterator-requirements"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id54" name="transform-iterator-requirements"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></h4>
|
|
|
|
<p>The type <tt class="literal"><span class="pre">UnaryFunction</span></tt> must be Assignable, Copy Constructible, and
|
|
|
|
<p>The type <tt class="literal"><span class="pre">UnaryFunction</span></tt> must be Assignable, Copy Constructible, and
|
|
|
|
the expression <tt class="literal"><span class="pre">f(*i)</span></tt> must be valid where <tt class="literal"><span class="pre">f</span></tt> is an object of
|
|
|
|
the expression <tt class="literal"><span class="pre">f(*i)</span></tt> must be valid where <tt class="literal"><span class="pre">f</span></tt> is an object of
|
|
|
|
type <tt class="literal"><span class="pre">UnaryFunction</span></tt>, <tt class="literal"><span class="pre">i</span></tt> is an object of type <tt class="literal"><span class="pre">Iterator</span></tt>, and
|
|
|
|
type <tt class="literal"><span class="pre">UnaryFunction</span></tt>, <tt class="literal"><span class="pre">i</span></tt> is an object of type <tt class="literal"><span class="pre">Iterator</span></tt>, and
|
|
|
@ -1831,7 +1756,7 @@ where the type of <tt class="literal"><span class="pre">f(*i)</span></tt> must b
|
|
|
|
<p>The argument <tt class="literal"><span class="pre">Iterator</span></tt> shall model Readable Iterator.</p>
|
|
|
|
<p>The argument <tt class="literal"><span class="pre">Iterator</span></tt> shall model Readable Iterator.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="transform-iterator-models">
|
|
|
|
<div class="section" id="transform-iterator-models">
|
|
|
|
<h4><a class="toc-backref" href="#id56" name="transform-iterator-models"><tt class="literal"><span class="pre">transform_iterator</span></tt> models</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id55" name="transform-iterator-models"><tt class="literal"><span class="pre">transform_iterator</span></tt> models</a></h4>
|
|
|
|
<p>The resulting <tt class="literal"><span class="pre">transform_iterator</span></tt> models the most refined of the
|
|
|
|
<p>The resulting <tt class="literal"><span class="pre">transform_iterator</span></tt> models the most refined of the
|
|
|
|
following options that is also modeled by <tt class="literal"><span class="pre">Iterator</span></tt>.</p>
|
|
|
|
following options that is also modeled by <tt class="literal"><span class="pre">Iterator</span></tt>.</p>
|
|
|
|
<blockquote>
|
|
|
|
<blockquote>
|
|
|
@ -1878,7 +1803,7 @@ mutable iterator (as defined in the old iterator requirements).</p>
|
|
|
|
interoperable with iterator <tt class="literal"><span class="pre">Y</span></tt>.</p>
|
|
|
|
interoperable with iterator <tt class="literal"><span class="pre">Y</span></tt>.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="transform-iterator-operations">
|
|
|
|
<div class="section" id="transform-iterator-operations">
|
|
|
|
<h4><a class="toc-backref" href="#id57" name="transform-iterator-operations"><tt class="literal"><span class="pre">transform_iterator</span></tt> operations</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id56" name="transform-iterator-operations"><tt class="literal"><span class="pre">transform_iterator</span></tt> operations</a></h4>
|
|
|
|
<p>In addition to the operations required by the concepts modeled by
|
|
|
|
<p>In addition to the operations required by the concepts modeled by
|
|
|
|
<tt class="literal"><span class="pre">transform_iterator</span></tt>, <tt class="literal"><span class="pre">transform_iterator</span></tt> provides the following
|
|
|
|
<tt class="literal"><span class="pre">transform_iterator</span></tt>, <tt class="literal"><span class="pre">transform_iterator</span></tt> provides the following
|
|
|
|
operations.</p>
|
|
|
|
operations.</p>
|
|
|
@ -1971,7 +1896,7 @@ transform_iterator(
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="filter-iterator">
|
|
|
|
<div class="section" id="filter-iterator">
|
|
|
|
<h3><a class="toc-backref" href="#id58" name="filter-iterator">Filter iterator</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id57" name="filter-iterator">Filter iterator</a></h3>
|
|
|
|
<p>The filter iterator adaptor creates a view of an iterator range in
|
|
|
|
<p>The filter iterator adaptor creates a view of an iterator range in
|
|
|
|
which some elements of the range are skipped. A predicate function
|
|
|
|
which some elements of the range are skipped. A predicate function
|
|
|
|
object controls which elements are skipped. When the predicate is
|
|
|
|
object controls which elements are skipped. When the predicate is
|
|
|
@ -1983,7 +1908,7 @@ underlying range. A filter iterator is therefore constructed with pair
|
|
|
|
of iterators indicating the range of elements in the unfiltered
|
|
|
|
of iterators indicating the range of elements in the unfiltered
|
|
|
|
sequence to be traversed.</p>
|
|
|
|
sequence to be traversed.</p>
|
|
|
|
<div class="section" id="class-template-filter-iterator">
|
|
|
|
<div class="section" id="class-template-filter-iterator">
|
|
|
|
<h4><a class="toc-backref" href="#id59" name="class-template-filter-iterator">Class template <tt class="literal"><span class="pre">filter_iterator</span></tt></a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id58" name="class-template-filter-iterator">Class template <tt class="literal"><span class="pre">filter_iterator</span></tt></a></h4>
|
|
|
|
<!-- Copyright David Abrahams, Jeremy Siek, and Thomas Witt -->
|
|
|
|
<!-- Copyright David Abrahams, Jeremy Siek, and Thomas Witt -->
|
|
|
|
<!-- 2004. Use, modification and distribution is subject to the Boost -->
|
|
|
|
<!-- 2004. Use, modification and distribution is subject to the Boost -->
|
|
|
|
<!-- Software License, Version 1.0. (See accompanying file -->
|
|
|
|
<!-- Software License, Version 1.0. (See accompanying file -->
|
|
|
@ -2024,7 +1949,7 @@ Iterator then <tt class="literal"><span class="pre">iterator_category</span></tt
|
|
|
|
convertible to <tt class="literal"><span class="pre">std::input_iterator_tag</span></tt>.</p>
|
|
|
|
convertible to <tt class="literal"><span class="pre">std::input_iterator_tag</span></tt>.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="filter-iterator-requirements">
|
|
|
|
<div class="section" id="filter-iterator-requirements">
|
|
|
|
<h4><a class="toc-backref" href="#id60" name="filter-iterator-requirements"><tt class="literal"><span class="pre">filter_iterator</span></tt> requirements</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id59" name="filter-iterator-requirements"><tt class="literal"><span class="pre">filter_iterator</span></tt> requirements</a></h4>
|
|
|
|
<p>The <tt class="literal"><span class="pre">Predicate</span></tt> argument must be Assignable, Copy Constructible, and
|
|
|
|
<p>The <tt class="literal"><span class="pre">Predicate</span></tt> argument must be Assignable, Copy Constructible, and
|
|
|
|
the expression <tt class="literal"><span class="pre">p(x)</span></tt> must be valid where <tt class="literal"><span class="pre">p</span></tt> is an object of type
|
|
|
|
the expression <tt class="literal"><span class="pre">p(x)</span></tt> must be valid where <tt class="literal"><span class="pre">p</span></tt> is an object of type
|
|
|
|
<tt class="literal"><span class="pre">Predicate</span></tt>, <tt class="literal"><span class="pre">x</span></tt> is an object of type
|
|
|
|
<tt class="literal"><span class="pre">Predicate</span></tt>, <tt class="literal"><span class="pre">x</span></tt> is an object of type
|
|
|
@ -2035,7 +1960,7 @@ Iterator and Single Pass Iterator or it shall meet the requirements of
|
|
|
|
Input Iterator.</p>
|
|
|
|
Input Iterator.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="filter-iterator-models">
|
|
|
|
<div class="section" id="filter-iterator-models">
|
|
|
|
<h4><a class="toc-backref" href="#id61" name="filter-iterator-models"><tt class="literal"><span class="pre">filter_iterator</span></tt> models</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id60" name="filter-iterator-models"><tt class="literal"><span class="pre">filter_iterator</span></tt> models</a></h4>
|
|
|
|
<p>The concepts that <tt class="literal"><span class="pre">filter_iterator</span></tt> models are dependent on which
|
|
|
|
<p>The concepts that <tt class="literal"><span class="pre">filter_iterator</span></tt> models are dependent on which
|
|
|
|
concepts the <tt class="literal"><span class="pre">Iterator</span></tt> argument models, as specified in the
|
|
|
|
concepts the <tt class="literal"><span class="pre">Iterator</span></tt> argument models, as specified in the
|
|
|
|
following tables.</p>
|
|
|
|
following tables.</p>
|
|
|
@ -2106,7 +2031,7 @@ following tables.</p>
|
|
|
|
if and only if iterator <tt class="literal"><span class="pre">X</span></tt> is interoperable with iterator <tt class="literal"><span class="pre">Y</span></tt>.</p>
|
|
|
|
if and only if iterator <tt class="literal"><span class="pre">X</span></tt> is interoperable with iterator <tt class="literal"><span class="pre">Y</span></tt>.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="filter-iterator-operations">
|
|
|
|
<div class="section" id="filter-iterator-operations">
|
|
|
|
<h4><a class="toc-backref" href="#id62" name="filter-iterator-operations"><tt class="literal"><span class="pre">filter_iterator</span></tt> operations</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id61" name="filter-iterator-operations"><tt class="literal"><span class="pre">filter_iterator</span></tt> operations</a></h4>
|
|
|
|
<p>In addition to those operations required by the concepts that
|
|
|
|
<p>In addition to those operations required by the concepts that
|
|
|
|
<tt class="literal"><span class="pre">filter_iterator</span></tt> models, <tt class="literal"><span class="pre">filter_iterator</span></tt> provides the following
|
|
|
|
<tt class="literal"><span class="pre">filter_iterator</span></tt> models, <tt class="literal"><span class="pre">filter_iterator</span></tt> provides the following
|
|
|
|
operations.</p>
|
|
|
|
operations.</p>
|
|
|
@ -2217,12 +2142,12 @@ or <tt class="literal"><span class="pre">m_pred(*m_iter)</span> <span class="pre
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="counting-iterator">
|
|
|
|
<div class="section" id="counting-iterator">
|
|
|
|
<h3><a class="toc-backref" href="#id63" name="counting-iterator">Counting iterator</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id62" name="counting-iterator">Counting iterator</a></h3>
|
|
|
|
<p><tt class="literal"><span class="pre">counting_iterator</span></tt> adapts an object by adding an <tt class="literal"><span class="pre">operator*</span></tt> that
|
|
|
|
<p><tt class="literal"><span class="pre">counting_iterator</span></tt> adapts an object by adding an <tt class="literal"><span class="pre">operator*</span></tt> that
|
|
|
|
returns the current value of the object. All other iterator operations
|
|
|
|
returns the current value of the object. All other iterator operations
|
|
|
|
are forwarded to the adapted object.</p>
|
|
|
|
are forwarded to the adapted object.</p>
|
|
|
|
<div class="section" id="class-template-counting-iterator">
|
|
|
|
<div class="section" id="class-template-counting-iterator">
|
|
|
|
<h4><a class="toc-backref" href="#id64" name="class-template-counting-iterator">Class template <tt class="literal"><span class="pre">counting_iterator</span></tt></a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id63" name="class-template-counting-iterator">Class template <tt class="literal"><span class="pre">counting_iterator</span></tt></a></h4>
|
|
|
|
<pre class="literal-block">
|
|
|
|
<pre class="literal-block">
|
|
|
|
template <
|
|
|
|
template <
|
|
|
|
class Incrementable
|
|
|
|
class Incrementable
|
|
|
@ -2255,17 +2180,18 @@ type. Otherwise <tt class="literal"><span class="pre">difference_type</span></tt
|
|
|
|
<p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is not <tt class="literal"><span class="pre">use_default</span></tt> then the member
|
|
|
|
<p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is not <tt class="literal"><span class="pre">use_default</span></tt> then the member
|
|
|
|
<tt class="literal"><span class="pre">iterator_category</span></tt> is <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>. Otherwise, if
|
|
|
|
<tt class="literal"><span class="pre">iterator_category</span></tt> is <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>. Otherwise, if
|
|
|
|
<tt class="literal"><span class="pre">numeric_limits<Incrementable>::is_specialized</span></tt>, then
|
|
|
|
<tt class="literal"><span class="pre">numeric_limits<Incrementable>::is_specialized</span></tt>, then
|
|
|
|
<tt class="literal"><span class="pre">iterator_category</span></tt> is a type convertible to
|
|
|
|
<tt class="literal"><span class="pre">iterator_category</span></tt> is a
|
|
|
|
<tt class="literal"><span class="pre">random_access_iterator_tag</span></tt>. Otherwise, <tt class="literal"><span class="pre">iterator_category</span></tt> is
|
|
|
|
<tt class="literal"><span class="pre">facade_iterator_category(random_access_traversal_tag,</span> <span class="pre">Incrementable,</span> <span class="pre">const</span> <span class="pre">Incrementable&)</span></tt>.
|
|
|
|
unspecified.</p>
|
|
|
|
Otherwise, <tt class="literal"><span class="pre">iterator_category</span></tt> is
|
|
|
|
|
|
|
|
<tt class="literal"><span class="pre">facade_iterator_category(iterator_traversal<Incrementable>::type,</span> <span class="pre">Incrementable,</span> <span class="pre">const</span> <span class="pre">Incrementable&)</span></tt>.</p>
|
|
|
|
<dl>
|
|
|
|
<dl>
|
|
|
|
<dt>[<em>Note:</em> implementers are encouraged to provide an implementation of</dt>
|
|
|
|
<dt>[<em>Note:</em> implementers are encouraged to provide an implementation of</dt>
|
|
|
|
<dd><tt class="literal"><span class="pre">operator-</span></tt> and a <tt class="literal"><span class="pre">difference_type</span></tt> that avoids overflows in
|
|
|
|
<dd><tt class="literal"><span class="pre">operator-</span></tt> and the default <tt class="literal"><span class="pre">difference_type</span></tt> that avoids overflows in
|
|
|
|
the cases when the <tt class="literal"><span class="pre">Incrementable</span></tt> type is a numeric type.]</dd>
|
|
|
|
the cases when the <tt class="literal"><span class="pre">Incrementable</span></tt> type is a numeric type.]</dd>
|
|
|
|
</dl>
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="counting-iterator-requirements">
|
|
|
|
<div class="section" id="counting-iterator-requirements">
|
|
|
|
<h4><a class="toc-backref" href="#id65" name="counting-iterator-requirements"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id64" name="counting-iterator-requirements"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></h4>
|
|
|
|
<p>The <tt class="literal"><span class="pre">Incrementable</span></tt> argument shall be Copy Constructible and Assignable.</p>
|
|
|
|
<p>The <tt class="literal"><span class="pre">Incrementable</span></tt> argument shall be Copy Constructible and Assignable.</p>
|
|
|
|
<p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to <tt class="literal"><span class="pre">forward_iterator_tag</span></tt>
|
|
|
|
<p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to <tt class="literal"><span class="pre">forward_iterator_tag</span></tt>
|
|
|
|
or <tt class="literal"><span class="pre">forward_traversal_tag</span></tt>, the following must be well-formed:</p>
|
|
|
|
or <tt class="literal"><span class="pre">forward_traversal_tag</span></tt>, the following must be well-formed:</p>
|
|
|
@ -2291,7 +2217,7 @@ i < j;
|
|
|
|
</pre>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="counting-iterator-models">
|
|
|
|
<div class="section" id="counting-iterator-models">
|
|
|
|
<h4><a class="toc-backref" href="#id66" name="counting-iterator-models"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id65" name="counting-iterator-models"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></h4>
|
|
|
|
<p>Specializations of <tt class="literal"><span class="pre">counting_iterator</span></tt> model Readable Lvalue
|
|
|
|
<p>Specializations of <tt class="literal"><span class="pre">counting_iterator</span></tt> model Readable Lvalue
|
|
|
|
Iterator. In addition, they model the concepts corresponding to the
|
|
|
|
Iterator. In addition, they model the concepts corresponding to the
|
|
|
|
iterator tags to which their <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible.
|
|
|
|
iterator tags to which their <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible.
|
|
|
@ -2307,7 +2233,7 @@ concepts modeled by <tt class="literal"><span class="pre">Incrementable</span></
|
|
|
|
interoperable with iterator <tt class="literal"><span class="pre">Y</span></tt>.</p>
|
|
|
|
interoperable with iterator <tt class="literal"><span class="pre">Y</span></tt>.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="counting-iterator-operations">
|
|
|
|
<div class="section" id="counting-iterator-operations">
|
|
|
|
<h4><a class="toc-backref" href="#id67" name="counting-iterator-operations"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id66" name="counting-iterator-operations"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></h4>
|
|
|
|
<p>In addition to the operations required by the concepts modeled by
|
|
|
|
<p>In addition to the operations required by the concepts modeled by
|
|
|
|
<tt class="literal"><span class="pre">counting_iterator</span></tt>, <tt class="literal"><span class="pre">counting_iterator</span></tt> provides the following
|
|
|
|
<tt class="literal"><span class="pre">counting_iterator</span></tt>, <tt class="literal"><span class="pre">counting_iterator</span></tt> provides the following
|
|
|
|
operations.</p>
|
|
|
|
operations.</p>
|
|
|
@ -2383,7 +2309,7 @@ operations.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="function-output-iterator">
|
|
|
|
<div class="section" id="function-output-iterator">
|
|
|
|
<h3><a class="toc-backref" href="#id68" name="function-output-iterator">Function output iterator</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id67" name="function-output-iterator">Function output iterator</a></h3>
|
|
|
|
<p>The function output iterator adaptor makes it easier to create custom
|
|
|
|
<p>The function output iterator adaptor makes it easier to create custom
|
|
|
|
output iterators. The adaptor takes a unary function and creates a
|
|
|
|
output iterators. The adaptor takes a unary function and creates a
|
|
|
|
model of Output Iterator. Each item assigned to the output iterator is
|
|
|
|
model of Output Iterator. Each item assigned to the output iterator is
|
|
|
@ -2392,7 +2318,7 @@ iterator is that creating a conforming output iterator is non-trivial,
|
|
|
|
particularly because the proper implementation usually requires a
|
|
|
|
particularly because the proper implementation usually requires a
|
|
|
|
proxy object.</p>
|
|
|
|
proxy object.</p>
|
|
|
|
<div class="section" id="class-template-function-output-iterator">
|
|
|
|
<div class="section" id="class-template-function-output-iterator">
|
|
|
|
<h4><a class="toc-backref" href="#id69" name="class-template-function-output-iterator">Class template <tt class="literal"><span class="pre">function_output_iterator</span></tt></a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id68" name="class-template-function-output-iterator">Class template <tt class="literal"><span class="pre">function_output_iterator</span></tt></a></h4>
|
|
|
|
<pre class="literal-block">
|
|
|
|
<pre class="literal-block">
|
|
|
|
template <class UnaryFunction>
|
|
|
|
template <class UnaryFunction>
|
|
|
|
class function_output_iterator {
|
|
|
|
class function_output_iterator {
|
|
|
@ -2414,16 +2340,16 @@ private:
|
|
|
|
</pre>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="function-output-iterator-requirements">
|
|
|
|
<div class="section" id="function-output-iterator-requirements">
|
|
|
|
<h4><a class="toc-backref" href="#id70" name="function-output-iterator-requirements"><tt class="literal"><span class="pre">function_output_iterator</span></tt> requirements</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id69" name="function-output-iterator-requirements"><tt class="literal"><span class="pre">function_output_iterator</span></tt> requirements</a></h4>
|
|
|
|
<p><tt class="literal"><span class="pre">UnaryFunction</span></tt> must be Assignable and Copy Constructible.</p>
|
|
|
|
<p><tt class="literal"><span class="pre">UnaryFunction</span></tt> must be Assignable and Copy Constructible.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="function-output-iterator-models">
|
|
|
|
<div class="section" id="function-output-iterator-models">
|
|
|
|
<h4><a class="toc-backref" href="#id71" name="function-output-iterator-models"><tt class="literal"><span class="pre">function_output_iterator</span></tt> models</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id70" name="function-output-iterator-models"><tt class="literal"><span class="pre">function_output_iterator</span></tt> models</a></h4>
|
|
|
|
<p><tt class="literal"><span class="pre">function_output_iterator</span></tt> is a model of the Writable and
|
|
|
|
<p><tt class="literal"><span class="pre">function_output_iterator</span></tt> is a model of the Writable and
|
|
|
|
Incrementable Iterator concepts.</p>
|
|
|
|
Incrementable Iterator concepts.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section" id="function-output-iterator-operations">
|
|
|
|
<div class="section" id="function-output-iterator-operations">
|
|
|
|
<h4><a class="toc-backref" href="#id72" name="function-output-iterator-operations"><tt class="literal"><span class="pre">function_output_iterator</span></tt> operations</a></h4>
|
|
|
|
<h4><a class="toc-backref" href="#id71" name="function-output-iterator-operations"><tt class="literal"><span class="pre">function_output_iterator</span></tt> operations</a></h4>
|
|
|
|
<p><tt class="literal"><span class="pre">explicit</span> <span class="pre">function_output_iterator(const</span> <span class="pre">UnaryFunction&</span> <span class="pre">f</span> <span class="pre">=</span> <span class="pre">UnaryFunction());</span></tt></p>
|
|
|
|
<p><tt class="literal"><span class="pre">explicit</span> <span class="pre">function_output_iterator(const</span> <span class="pre">UnaryFunction&</span> <span class="pre">f</span> <span class="pre">=</span> <span class="pre">UnaryFunction());</span></tt></p>
|
|
|
|
<table class="field-list" frame="void" rules="none">
|
|
|
|
<table class="field-list" frame="void" rules="none">
|
|
|
|
<col class="field-name" />
|
|
|
|
<col class="field-name" />
|
|
|
|