<metaname="author"content="David Abrahams, Jeremy Siek, Thomas Witt"/>
<metaname="organization"content="Boost Consulting, Indiana University Open Systems Lab, University of Hanover Institute for Transport Railway Operation and Construction"/>
<td><aclass="first reference"href="http://www.boost-consulting.com">Boost Consulting</a>, Indiana University <aclass="reference"href="http://www.osl.iu.edu">Open Systems
Lab</a>, University of Hanover <aclass="last reference"href="http://www.ive.uni-hannover.de">Institute for Transport
<trclass="field"><thclass="field-name">abstract:</th><tdclass="field-body"><ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> adapts an iterator by applying an
<em>extra</em> dereference inside of <ttclass="literal"><spanclass="pre">operator*()</span></tt>. For example, this
iterator adaptor makes it possible to view a container of pointers
(e.g. <ttclass="literal"><spanclass="pre">list<foo></span></tt>). <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> depends on two
auxiliary traits, <ttclass="literal"><spanclass="pre">pointee</span></tt> and <ttclass="literal"><spanclass="pre">indirect_reference</span></tt>, to
provide support for underlying iterators whose <ttclass="literal"><spanclass="pre">value_type</span></tt> is
<p><ttclass="literal"><spanclass="pre">iterator_category</span></tt> satisfies the following conditions, where
<ttclass="literal"><spanclass="pre">R</span></tt> is <ttclass="literal"><spanclass="pre">reference</span></tt> and <ttclass="literal"><spanclass="pre">V</span></tt> is <ttclass="literal"><spanclass="pre">value_type</span></tt>, and where: if
<ttclass="literal"><spanclass="pre">CategoryOrTraversal</span></tt> is <ttclass="literal"><spanclass="pre">use_default</span></tt>, <ttclass="literal"><spanclass="pre">C</span></tt> is
<ttclass="literal"><spanclass="pre">iterator_traversal<Iterator>::type</span></tt> and otherwise <ttclass="literal"><spanclass="pre">C</span></tt> is
<li><pclass="first">if <ttclass="literal"><spanclass="pre">C</span></tt> is convertible to <ttclass="literal"><spanclass="pre">std::input_iterator_tag</span></tt> or
<ttclass="literal"><spanclass="pre">C</span></tt> is convertible to <ttclass="literal"><spanclass="pre">std::output_iterator_tag</span></tt>,
<ttclass="literal"><spanclass="pre">iterator_category</span></tt> is the same as <ttclass="literal"><spanclass="pre">C</span></tt>.</p>
</li>
<li><pclass="first">Otherwise, if <ttclass="literal"><spanclass="pre">C</span></tt> is not convertible to
<ttclass="literal"><spanclass="pre">incrementable_traversal_tag</span></tt>, the program is ill-formed</p>
</li>
<li><pclass="first">Otherwise:</p>
<ul>
<li><pclass="first"><ttclass="literal"><spanclass="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>
<p><ttclass="literal"><spanclass="pre">CategoryOrTraversal</span></tt> argument shall be <ttclass="literal"><spanclass="pre">use_default</span></tt> or it
shall be convertible to one of the standard iterator or traversal
tags. If <ttclass="literal"><spanclass="pre">CategoryOrTraversal</span></tt> is not <ttclass="literal"><spanclass="pre">use_default</span></tt>, it shall
indicate the traversal category modeled by <ttclass="literal"><spanclass="pre">Iterator</span></tt>. If</p>
<ttclass="literal"><spanclass="pre">indirect_iterator::value</span></tt>. There are further requirements on
the <ttclass="literal"><spanclass="pre">iterator_traits<Iterator>::value_type</span></tt> if the <ttclass="literal"><spanclass="pre">Value</span></tt>
parameter is not <ttclass="literal"><spanclass="pre">use_default</span></tt>, as implied by the algorithm for
deducing the default for the <ttclass="literal"><spanclass="pre">value_type</span></tt> member.</p>
<p>If <ttclass="literal"><spanclass="pre">CategoryOrTraversal</span></tt> is a standard iterator tag,
<ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> is a model of the iterator concept corresponding
to the tag, otherwise <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> satisfies the requirements
of the most refined standard traversal concept that is satisfied by
the <ttclass="literal"><spanclass="pre">Iterator</span></tt> argument.</p>
<p><ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> models Readable Iterator. If
<ttclass="literal"><spanclass="pre">indirect_iterator::reference(*v)</span><spanclass="pre">=</span><spanclass="pre">t</span></tt> is a valid expression (where
<ttclass="literal"><spanclass="pre">t</span></tt> is an object of type <ttclass="literal"><spanclass="pre">indirect_iterator::value_type</span></tt>) then
<ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> models Writable Iterator. If
<ttclass="literal"><spanclass="pre">indirect_iterator::reference</span></tt> is a reference then
<p>In addition to the operations required by the concepts modeled by
<ttclass="literal"><spanclass="pre">indirect_iterator</span></tt>, <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> provides the following
<trclass="field"><thclass="field-name">Requires:</th><tdclass="field-body"><ttclass="literal"><spanclass="pre">Iterator</span></tt> must be Default Constructible.</td>
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> with
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> with
<trclass="field"><thclass="field-name">Requires:</th><tdclass="field-body"><ttclass="literal"><spanclass="pre">Iterator2</span></tt> is implicitly convertible to <ttclass="literal"><spanclass="pre">Iterator</span></tt>.</td>
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> whose
<ttclass="literal"><spanclass="pre">m_iterator</span></tt> subobject is constructed from <ttclass="literal"><spanclass="pre">y.base()</span></tt>.</td>
Generated by <aclass="reference"href="http://docutils.sourceforge.net/">Docutils</a> from <aclass="reference"href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.