mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-22 17:07:16 +02:00
Some progress on indirect_iterator
[SVN r21704]
This commit is contained in:
@ -36,14 +36,14 @@ Railway Operation and Construction</a></td></tr>
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field"><th class="field-name">abstract:</th><td class="field-body"><p class="first">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
|
||||
<tr class="field"><th class="field-name">abstract:</th><td class="field-body"><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 -->
|
||||
</td>
|
||||
(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.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -103,21 +103,21 @@ 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;
|
||||
else
|
||||
if (Value is use_default) then
|
||||
typedef pointee<V>::type* pointer;
|
||||
else
|
||||
typedef Value* pointer;
|
||||
|
||||
if (Difference is use_default)
|
||||
@ -128,7 +128,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
|
||||
@ -327,7 +327,7 @@ a,b,c,d,e,f,g,
|
||||
<hr class="footer" />
|
||||
<div class="footer">
|
||||
<a class="reference" href="indirect_iterator.rst">View document source</a>.
|
||||
Generated on: 2004-01-13 14:26 UTC.
|
||||
Generated on: 2004-01-13 19:54 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>
|
||||
|
Reference in New Issue
Block a user