|
|
|
@ -93,45 +93,47 @@ by adapting other iterators.</td>
|
|
|
|
|
</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="#indirect-iterator" id="id41" name="id41">Indirect iterator</a><ul>
|
|
|
|
|
<li><a class="reference" href="#class-template-indirect-iterator" id="id42" name="id42">Class template <tt class="literal"><span class="pre">indirect_iterator</span></tt></a></li>
|
|
|
|
|
<li><a class="reference" href="#indirect-iterator-requirements" id="id43" name="id43"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></li>
|
|
|
|
|
<li><a class="reference" href="#indirect-iterator-models" id="id44" name="id44"><tt class="literal"><span class="pre">indirect_iterator</span></tt> models</a></li>
|
|
|
|
|
<li><a class="reference" href="#indirect-iterator-operations" id="id45" name="id45"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></li>
|
|
|
|
|
<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-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-iterator" id="id44" name="id44">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-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-operations" id="id47" name="id47"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
<li><a class="reference" href="#reverse-iterator" id="id46" name="id46">Reverse iterator</a><ul>
|
|
|
|
|
<li><a class="reference" href="#class-template-reverse-iterator" id="id47" name="id47">Class template <tt class="literal"><span class="pre">reverse_iterator</span></tt></a></li>
|
|
|
|
|
<li><a class="reference" href="#reverse-iterator-requirements" id="id48" name="id48"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></li>
|
|
|
|
|
<li><a class="reference" href="#reverse-iterator-models" id="id49" name="id49"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></li>
|
|
|
|
|
<li><a class="reference" href="#reverse-iterator-operations" id="id50" name="id50"><tt class="literal"><span class="pre">reverse_iterator</span></tt> operations</a></li>
|
|
|
|
|
<li><a class="reference" href="#reverse-iterator" id="id48" name="id48">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="#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-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-operations" id="id52" name="id52"><tt class="literal"><span class="pre">reverse_iterator</span></tt> operations</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
<li><a class="reference" href="#transform-iterator" id="id51" name="id51">Transform iterator</a><ul>
|
|
|
|
|
<li><a class="reference" href="#class-template-transform-iterator" id="id52" name="id52">Class template <tt class="literal"><span class="pre">transform_iterator</span></tt></a></li>
|
|
|
|
|
<li><a class="reference" href="#transform-iterator-requirements" id="id53" name="id53"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></li>
|
|
|
|
|
<li><a class="reference" href="#transform-iterator-models" id="id54" name="id54"><tt class="literal"><span class="pre">transform_iterator</span></tt> models</a></li>
|
|
|
|
|
<li><a class="reference" href="#transform-iterator-operations" id="id55" name="id55"><tt class="literal"><span class="pre">transform_iterator</span></tt> operations</a></li>
|
|
|
|
|
<li><a class="reference" href="#transform-iterator" id="id53" name="id53">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="#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-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-operations" id="id57" name="id57"><tt class="literal"><span class="pre">transform_iterator</span></tt> operations</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
<li><a class="reference" href="#filter-iterator" id="id56" name="id56">Filter iterator</a><ul>
|
|
|
|
|
<li><a class="reference" href="#class-template-filter-iterator" id="id57" name="id57">Class template <tt class="literal"><span class="pre">filter_iterator</span></tt></a></li>
|
|
|
|
|
<li><a class="reference" href="#filter-iterator-requirements" id="id58" name="id58"><tt class="literal"><span class="pre">filter_iterator</span></tt> requirements</a></li>
|
|
|
|
|
<li><a class="reference" href="#filter-iterator-models" id="id59" name="id59"><tt class="literal"><span class="pre">filter_iterator</span></tt> models</a></li>
|
|
|
|
|
<li><a class="reference" href="#filter-iterator-operations" id="id60" name="id60"><tt class="literal"><span class="pre">filter_iterator</span></tt> operations</a></li>
|
|
|
|
|
<li><a class="reference" href="#filter-iterator" id="id58" name="id58">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="#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-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-operations" id="id62" name="id62"><tt class="literal"><span class="pre">filter_iterator</span></tt> operations</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
<li><a class="reference" href="#counting-iterator" id="id61" name="id61">Counting iterator</a><ul>
|
|
|
|
|
<li><a class="reference" href="#class-template-counting-iterator" id="id62" name="id62">Class template <tt class="literal"><span class="pre">counting_iterator</span></tt></a></li>
|
|
|
|
|
<li><a class="reference" href="#counting-iterator-requirements" id="id63" name="id63"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></li>
|
|
|
|
|
<li><a class="reference" href="#counting-iterator-models" id="id64" name="id64"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></li>
|
|
|
|
|
<li><a class="reference" href="#counting-iterator-operations" id="id65" name="id65"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></li>
|
|
|
|
|
<li><a class="reference" href="#counting-iterator" id="id63" name="id63">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="#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-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-operations" id="id67" name="id67"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
<li><a class="reference" href="#function-output-iterator" id="id66" name="id66">Function output iterator</a><ul>
|
|
|
|
|
<li><a class="reference" href="#class-template-function-output-iterator" id="id67" name="id67">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="id68" name="id68"><tt class="literal"><span class="pre">function_output_iterator</span></tt> requirements</a></li>
|
|
|
|
|
<li><a class="reference" href="#function-output-iterator-models" id="id69" name="id69"><tt class="literal"><span class="pre">function_output_iterator</span></tt> models</a></li>
|
|
|
|
|
<li><a class="reference" href="#function-output-iterator-operations" id="id70" name="id70"><tt class="literal"><span class="pre">function_output_iterator</span></tt> operations</a></li>
|
|
|
|
|
<li><a class="reference" href="#function-output-iterator" id="id68" name="id68">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="#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-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-operations" id="id72" name="id72"><tt class="literal"><span class="pre">function_output_iterator</span></tt> operations</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
@ -567,6 +569,12 @@ template <
|
|
|
|
|
>
|
|
|
|
|
class indirect_iterator;
|
|
|
|
|
|
|
|
|
|
template <class Dereferenceable>
|
|
|
|
|
struct pointee;
|
|
|
|
|
|
|
|
|
|
template <class Dereferenceable>
|
|
|
|
|
struct indirect_reference;
|
|
|
|
|
|
|
|
|
|
template <class Iterator>
|
|
|
|
|
class reverse_iterator;
|
|
|
|
|
|
|
|
|
@ -1247,15 +1255,95 @@ implicitly convertible.
|
|
|
|
|
]</p>
|
|
|
|
|
<div class="section" id="indirect-iterator">
|
|
|
|
|
<h3><a class="toc-backref" href="#id41" name="indirect-iterator">Indirect iterator</a></h3>
|
|
|
|
|
<p>The indirect iterator adapts an iterator by applying an <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
|
|
|
|
|
<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
|
|
|
|
|
iterator adaptor makes it possible to view a container of pointers
|
|
|
|
|
(e.g. <tt class="literal"><span class="pre">list<foo*></span></tt>) as if it were a container of the pointed-to type
|
|
|
|
|
(e.g. <tt class="literal"><span class="pre">list<foo></span></tt>) .</p>
|
|
|
|
|
<!-- At some point we should add the capability to handle
|
|
|
|
|
iterators over smart pointers, which the impl handles. -JGS -->
|
|
|
|
|
(e.g. <tt class="literal"><span class="pre">list<foo></span></tt>). <tt class="literal"><span class="pre">indirect_iterator</span></tt> depends on two
|
|
|
|
|
auxiliary traits, <tt class="literal"><span class="pre">pointee</span></tt> and <tt class="literal"><span class="pre">indirect_reference</span></tt>, to
|
|
|
|
|
provide support for underlying iterators whose <tt class="literal"><span class="pre">value_type</span></tt> is
|
|
|
|
|
not an iterator.</p>
|
|
|
|
|
<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>
|
|
|
|
|
<!-- 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) -->
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
template <class Dereferenceable>
|
|
|
|
|
struct pointee
|
|
|
|
|
{
|
|
|
|
|
typedef /* see below */ type;
|
|
|
|
|
};
|
|
|
|
|
</pre>
|
|
|
|
|
<table class="field-list" frame="void" rules="none">
|
|
|
|
|
<col class="field-name" />
|
|
|
|
|
<col class="field-body" />
|
|
|
|
|
<tbody valign="top">
|
|
|
|
|
<tr class="field"><th class="field-name">Requires:</th><td class="field-body">For an object <tt class="literal"><span class="pre">x</span></tt> of type <tt class="literal"><span class="pre">Dereferenceable</span></tt>, <tt class="literal"><span class="pre">*x</span></tt>
|
|
|
|
|
is well-formed. If <tt class="literal"><span class="pre">++x</span></tt> is ill-formed it shall neither be
|
|
|
|
|
ambiguous nor shall it violate access control, and
|
|
|
|
|
<tt class="literal"><span class="pre">Dereferenceable::element_type</span></tt> shall be an accessible type.
|
|
|
|
|
Otherwise <tt class="literal"><span class="pre">iterator_traits<Dereferenceable>::value_type</span></tt> shall
|
|
|
|
|
be well formed. [Note: These requirements need not apply to
|
|
|
|
|
explicit or partial specializations of <tt class="literal"><span class="pre">pointee</span></tt>]</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<p><tt class="literal"><span class="pre">type</span></tt> is determined according to the following algorithm, where
|
|
|
|
|
<tt class="literal"><span class="pre">x</span></tt> is an object of type <tt class="literal"><span class="pre">Dereferenceable</span></tt>:</p>
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
if ( ++x is ill-formed )
|
|
|
|
|
{
|
|
|
|
|
return ``Dereferenceable::element_type``
|
|
|
|
|
}
|
|
|
|
|
else if (``*x`` is a mutable reference to
|
|
|
|
|
std::iterator_traits<Dereferenceable>::value_type)
|
|
|
|
|
{
|
|
|
|
|
return iterator_traits<Dereferenceable>::value_type
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return iterator_traits<Dereferenceable>::value_type const
|
|
|
|
|
}
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
<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>
|
|
|
|
|
<!-- 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) -->
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
template <class Dereferenceable>
|
|
|
|
|
struct indirect_reference
|
|
|
|
|
{
|
|
|
|
|
typedef /* see below */ type;
|
|
|
|
|
};
|
|
|
|
|
</pre>
|
|
|
|
|
<table class="field-list" frame="void" rules="none">
|
|
|
|
|
<col class="field-name" />
|
|
|
|
|
<col class="field-body" />
|
|
|
|
|
<tbody valign="top">
|
|
|
|
|
<tr class="field"><th class="field-name">Requires:</th><td class="field-body">For an object <tt class="literal"><span class="pre">x</span></tt> of type <tt class="literal"><span class="pre">Dereferenceable</span></tt>, <tt class="literal"><span class="pre">*x</span></tt>
|
|
|
|
|
is well-formed. If <tt class="literal"><span class="pre">++x</span></tt> is ill-formed it shall neither be
|
|
|
|
|
ambiguous nor shall it violate access control, and
|
|
|
|
|
<tt class="literal"><span class="pre">pointee<Dereferenceable>::type&</span></tt> shall be well-formed.
|
|
|
|
|
Otherwise <tt class="literal"><span class="pre">iterator_traits<Dereferenceable>::reference</span></tt> shall
|
|
|
|
|
be well formed. [Note: These requirements need not apply to
|
|
|
|
|
explicit or partial specializations of <tt class="literal"><span class="pre">indirect_reference</span></tt>]</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<p><tt class="literal"><span class="pre">type</span></tt> is determined according to the following algorithm, where
|
|
|
|
|
<tt class="literal"><span class="pre">x</span></tt> is an object of type <tt class="literal"><span class="pre">Dereferenceable</span></tt>:</p>
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
if ( ++x is ill-formed )
|
|
|
|
|
return ``pointee<Dereferenceable>::type&``
|
|
|
|
|
else
|
|
|
|
|
std::iterator_traits<Dereferenceable>::value_type
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="class-template-indirect-iterator">
|
|
|
|
|
<h4><a class="toc-backref" href="#id42" 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="#id44" name="class-template-indirect-iterator">Class template <tt class="literal"><span class="pre">indirect_iterator</span></tt></a></h4>
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
template <
|
|
|
|
|
class Iterator
|
|
|
|
@ -1300,20 +1388,20 @@ following pseudo-code. We use the abbreviation
|
|
|
|
|
<tt class="literal"><span class="pre">V=iterator_traits<Iterator>::value_type</span></tt>.:</p>
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
if (Value is use_default) then
|
|
|
|
|
typedef iterator_traits<V>::value_type value_type;
|
|
|
|
|
typedef remove_const<pointee<V>::type>::type value_type;
|
|
|
|
|
else
|
|
|
|
|
typedef remove_const<Value>::type value_type;
|
|
|
|
|
|
|
|
|
|
if (Reference is use_default) then
|
|
|
|
|
if (Value is use_default) then
|
|
|
|
|
typedef iterator_traits<V>::reference reference;
|
|
|
|
|
typedef indirect_reference<V>::type reference;
|
|
|
|
|
else
|
|
|
|
|
typedef Value& reference;
|
|
|
|
|
else
|
|
|
|
|
typedef Reference reference;
|
|
|
|
|
|
|
|
|
|
if (Value is use_default) then
|
|
|
|
|
typedef iterator_traits<V>::value_type* pointer;
|
|
|
|
|
typedef pointee<V>::type* pointer;
|
|
|
|
|
else
|
|
|
|
|
typedef Value* pointer;
|
|
|
|
|
|
|
|
|
@ -1325,7 +1413,7 @@ else
|
|
|
|
|
<p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is not <tt class="literal"><span class="pre">use_default</span></tt> then
|
|
|
|
|
<tt class="literal"><span class="pre">iterator_category</span></tt> is <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>. Otherwise
|
|
|
|
|
<tt class="literal"><span class="pre">iterator_category</span></tt> is a type convertible to the tag determined by
|
|
|
|
|
the following algorithm. Let <tt class="literal"><span class="pre">C</span></tt> be <tt class="literal"><span class="pre">traveral_category<Iterator>::type</span></tt>.</p>
|
|
|
|
|
the following algorithm. Let <tt class="literal"><span class="pre">C</span></tt> be <tt class="literal"><span class="pre">traversal_category<Iterator>::type</span></tt>.</p>
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
if (reference is a reference to value_type) then
|
|
|
|
|
if (C is convertible to random_access_traversal_tag) then
|
|
|
|
@ -1339,7 +1427,7 @@ else
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="indirect-iterator-requirements">
|
|
|
|
|
<h4><a class="toc-backref" href="#id43" name="indirect-iterator-requirements"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id45" name="indirect-iterator-requirements"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></h4>
|
|
|
|
|
<p>The <tt class="literal"><span class="pre">Iterator</span></tt> argument shall meet the requirements of Readable
|
|
|
|
|
Iterator. The <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> argument shall be one of the
|
|
|
|
|
standard iterator tags or <tt class="literal"><span class="pre">use_default</span></tt>. If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>
|
|
|
|
@ -1355,7 +1443,7 @@ is not <tt class="literal"><span class="pre">use_default</span></tt>, as implied
|
|
|
|
|
default for the <tt class="literal"><span class="pre">value_type</span></tt> member.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="indirect-iterator-models">
|
|
|
|
|
<h4><a class="toc-backref" href="#id44" name="indirect-iterator-models"><tt class="literal"><span class="pre">indirect_iterator</span></tt> models</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id46" name="indirect-iterator-models"><tt class="literal"><span class="pre">indirect_iterator</span></tt> models</a></h4>
|
|
|
|
|
<p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is a standard iterator tag,
|
|
|
|
|
<tt class="literal"><span class="pre">indirect_iterator</span></tt> is a model of the iterator concept corresponding
|
|
|
|
|
to the tag, otherwise <tt class="literal"><span class="pre">indirect_iterator</span></tt> satisfies the requirements
|
|
|
|
@ -1369,7 +1457,7 @@ the <tt class="literal"><span class="pre">Iterator</span></tt> argument.</p>
|
|
|
|
|
<tt class="literal"><span class="pre">indirect_iterator</span></tt> models Lvalue Iterator.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="indirect-iterator-operations">
|
|
|
|
|
<h4><a class="toc-backref" href="#id45" name="indirect-iterator-operations"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id47" 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 modeled by
|
|
|
|
|
<tt class="literal"><span class="pre">indirect_iterator</span></tt>, <tt class="literal"><span class="pre">indirect_iterator</span></tt> provides the following
|
|
|
|
|
operations.</p>
|
|
|
|
@ -1461,11 +1549,11 @@ indirect_iterator(
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="reverse-iterator">
|
|
|
|
|
<h3><a class="toc-backref" href="#id46" name="reverse-iterator">Reverse iterator</a></h3>
|
|
|
|
|
<h3><a class="toc-backref" href="#id48" name="reverse-iterator">Reverse iterator</a></h3>
|
|
|
|
|
<p>The reverse iterator adaptor iterates through the adapted iterator
|
|
|
|
|
range in the opposite direction.</p>
|
|
|
|
|
<div class="section" id="class-template-reverse-iterator">
|
|
|
|
|
<h4><a class="toc-backref" href="#id47" 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="#id49" name="class-template-reverse-iterator">Class template <tt class="literal"><span class="pre">reverse_iterator</span></tt></a></h4>
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
template <class Iterator>
|
|
|
|
|
class reverse_iterator
|
|
|
|
@ -1502,11 +1590,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>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="reverse-iterator-requirements">
|
|
|
|
|
<h4><a class="toc-backref" href="#id48" name="reverse-iterator-requirements"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id50" 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>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="reverse-iterator-models">
|
|
|
|
|
<h4><a class="toc-backref" href="#id49" name="reverse-iterator-models"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id51" 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
|
|
|
|
|
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
|
|
|
|
@ -1544,7 +1632,7 @@ Random Access Traversal Iterator</td>
|
|
|
|
|
<tt class="literal"><span class="pre">reverse_iterator<X></span></tt> is interoperable with <tt class="literal"><span class="pre">reverse_iterator<Y></span></tt>.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="reverse-iterator-operations">
|
|
|
|
|
<h4><a class="toc-backref" href="#id50" name="reverse-iterator-operations"><tt class="literal"><span class="pre">reverse_iterator</span></tt> operations</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id52" 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
|
|
|
|
|
<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>
|
|
|
|
@ -1634,12 +1722,12 @@ return *--tmp;
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="transform-iterator">
|
|
|
|
|
<h3><a class="toc-backref" href="#id51" name="transform-iterator">Transform iterator</a></h3>
|
|
|
|
|
<h3><a class="toc-backref" href="#id53" name="transform-iterator">Transform iterator</a></h3>
|
|
|
|
|
<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
|
|
|
|
|
dereferencing the iterator and returning the result.</p>
|
|
|
|
|
<div class="section" id="class-template-transform-iterator">
|
|
|
|
|
<h4><a class="toc-backref" href="#id52" 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="#id54" 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 -->
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
template <class UnaryFunction,
|
|
|
|
@ -1692,7 +1780,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>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="transform-iterator-requirements">
|
|
|
|
|
<h4><a class="toc-backref" href="#id53" name="transform-iterator-requirements"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id55" 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
|
|
|
|
|
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
|
|
|
|
@ -1701,7 +1789,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>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="transform-iterator-models">
|
|
|
|
|
<h4><a class="toc-backref" href="#id54" name="transform-iterator-models"><tt class="literal"><span class="pre">transform_iterator</span></tt> models</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id56" 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
|
|
|
|
|
following options that is also modeled by <tt class="literal"><span class="pre">Iterator</span></tt>.</p>
|
|
|
|
|
<blockquote>
|
|
|
|
@ -1748,7 +1836,7 @@ mutable iterator (as defined in the old iterator requirements).</p>
|
|
|
|
|
<tt class="literal"><span class="pre">transform_iterator<F2,</span> <span class="pre">Y,</span> <span class="pre">R2,</span> <span class="pre">V2></span></tt>.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="transform-iterator-operations">
|
|
|
|
|
<h4><a class="toc-backref" href="#id55" name="transform-iterator-operations"><tt class="literal"><span class="pre">transform_iterator</span></tt> operations</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id57" 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
|
|
|
|
|
<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>
|
|
|
|
@ -1841,7 +1929,7 @@ transform_iterator(
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="filter-iterator">
|
|
|
|
|
<h3><a class="toc-backref" href="#id56" name="filter-iterator">Filter iterator</a></h3>
|
|
|
|
|
<h3><a class="toc-backref" href="#id58" name="filter-iterator">Filter iterator</a></h3>
|
|
|
|
|
<p>The filter iterator adaptor creates a view of an iterator range in
|
|
|
|
|
which some elements of the range are skipped. A predicate function
|
|
|
|
|
object controls which elements are skipped. When the predicate is
|
|
|
|
@ -1853,7 +1941,11 @@ underlying range. A filter iterator is therefore constructed with pair
|
|
|
|
|
of iterators indicating the range of elements in the unfiltered
|
|
|
|
|
sequence to be traversed.</p>
|
|
|
|
|
<div class="section" id="class-template-filter-iterator">
|
|
|
|
|
<h4><a class="toc-backref" href="#id57" 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="#id59" 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 -->
|
|
|
|
|
<!-- 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) -->
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
template <class Predicate, class Iterator>
|
|
|
|
|
class filter_iterator
|
|
|
|
@ -1890,7 +1982,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>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="filter-iterator-requirements">
|
|
|
|
|
<h4><a class="toc-backref" href="#id58" name="filter-iterator-requirements"><tt class="literal"><span class="pre">filter_iterator</span></tt> requirements</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id60" 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
|
|
|
|
|
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
|
|
|
|
@ -1901,7 +1993,7 @@ Iterator and Single Pass Iterator or it shall meet the requirements of
|
|
|
|
|
Input Iterator.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="filter-iterator-models">
|
|
|
|
|
<h4><a class="toc-backref" href="#id59" name="filter-iterator-models"><tt class="literal"><span class="pre">filter_iterator</span></tt> models</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id61" 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
|
|
|
|
|
concepts the <tt class="literal"><span class="pre">Iterator</span></tt> argument models, as specified in the
|
|
|
|
|
following tables.</p>
|
|
|
|
@ -1973,7 +2065,7 @@ following tables.</p>
|
|
|
|
|
<tt class="literal"><span class="pre">filter_iterator<P2,</span> <span class="pre">Y></span></tt>.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="filter-iterator-operations">
|
|
|
|
|
<h4><a class="toc-backref" href="#id60" name="filter-iterator-operations"><tt class="literal"><span class="pre">filter_iterator</span></tt> operations</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id62" 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
|
|
|
|
|
<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>
|
|
|
|
@ -2084,12 +2176,12 @@ or <tt class="literal"><span class="pre">m_pred(*m_iter)</span> <span class="pre
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="counting-iterator">
|
|
|
|
|
<h3><a class="toc-backref" href="#id61" name="counting-iterator">Counting iterator</a></h3>
|
|
|
|
|
<h3><a class="toc-backref" href="#id63" 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
|
|
|
|
|
returns the current value of the object. All other iterator operations
|
|
|
|
|
are forwarded to the adapted object.</p>
|
|
|
|
|
<div class="section" id="class-template-counting-iterator">
|
|
|
|
|
<h4><a class="toc-backref" href="#id62" 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="#id64" name="class-template-counting-iterator">Class template <tt class="literal"><span class="pre">counting_iterator</span></tt></a></h4>
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
template <
|
|
|
|
|
class Incrementable
|
|
|
|
@ -2132,7 +2224,7 @@ the cases when the <tt class="literal"><span class="pre">Incrementable</span></t
|
|
|
|
|
</dl>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="counting-iterator-requirements">
|
|
|
|
|
<h4><a class="toc-backref" href="#id63" name="counting-iterator-requirements"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id65" 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>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>
|
|
|
|
@ -2158,7 +2250,7 @@ i < j;
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="counting-iterator-models">
|
|
|
|
|
<h4><a class="toc-backref" href="#id64" name="counting-iterator-models"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id66" 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
|
|
|
|
|
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.
|
|
|
|
@ -2175,7 +2267,7 @@ concepts modeled by <tt class="literal"><span class="pre">Incrementable</span></
|
|
|
|
|
same traversal category and difference type.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="counting-iterator-operations">
|
|
|
|
|
<h4><a class="toc-backref" href="#id65" name="counting-iterator-operations"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></h4>
|
|
|
|
|
<h4><a class="toc-backref" href="#id67" 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
|
|
|
|
|
<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>
|
|
|
|
@ -2251,7 +2343,7 @@ operations.</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="function-output-iterator">
|
|
|
|
|
<h3><a class="toc-backref" href="#id66" name="function-output-iterator">Function output iterator</a></h3>
|
|
|
|
|
<h3><a class="toc-backref" href="#id68" name="function-output-iterator">Function output iterator</a></h3>
|
|
|
|
|
<p>The function output iterator adaptor makes it easier to create custom
|
|
|
|
|
output iterators. The adaptor takes a unary function and creates a
|
|
|
|
|
model of Output Iterator. Each item assigned to the output iterator is
|
|
|
|
@ -2260,7 +2352,7 @@ iterator is that creating a conforming output iterator is non-trivial,
|
|
|
|
|
particularly because the proper implementation usually requires a
|
|
|
|
|
proxy object.</p>
|
|
|
|
|
<div class="section" id="class-template-function-output-iterator">
|
|
|
|
|
<h4><a class="toc-backref" href="#id67" 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="#id69" 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">
|
|
|
|
|
template <class UnaryFunction>
|
|
|
|
|
class function_output_iterator {
|
|
|
|
@ -2282,16 +2374,16 @@ private:
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="function-output-iterator-requirements">
|
|
|
|
|
<h4><a class="toc-backref" href="#id68" 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="#id70" 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>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="function-output-iterator-models">
|
|
|
|
|
<h4><a class="toc-backref" href="#id69" 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="#id71" 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
|
|
|
|
|
Incrementable Iterator concepts.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="function-output-iterator-operations">
|
|
|
|
|
<h4><a class="toc-backref" href="#id70" 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="#id72" 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>
|
|
|
|
|
<table class="field-list" frame="void" rules="none">
|
|
|
|
|
<col class="field-name" />
|
|
|
|
@ -2344,7 +2436,7 @@ LocalWords: OtherIncrementable Coplien -->
|
|
|
|
|
<hr class="footer" />
|
|
|
|
|
<div class="footer">
|
|
|
|
|
<a class="reference" href="facade-and-adaptor.rst">View document source</a>.
|
|
|
|
|
Generated on: 2004-01-13 19:49 UTC.
|
|
|
|
|
Generated on: 2004-01-13 20:19 UTC.
|
|
|
|
|
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|