mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-29 12:27:33 +02:00
fixed a transform_iterator issue
[SVN r21688]
This commit is contained in:
@ -1672,23 +1672,22 @@ private:
|
||||
UnaryFunction m_f; // exposition only
|
||||
};
|
||||
</pre>
|
||||
<p>The <tt class="literal"><span class="pre">reference</span></tt> type of <tt class="literal"><span class="pre">transform_iterator</span></tt> is
|
||||
<p>If <tt class="literal"><span class="pre">Reference</span></tt> is <tt class="literal"><span class="pre">use_default</span></tt> then the <tt class="literal"><span class="pre">reference</span></tt> member of
|
||||
<tt class="literal"><span class="pre">transform_iterator</span></tt> is
|
||||
<tt class="literal"><span class="pre">result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type</span></tt>.
|
||||
The <tt class="literal"><span class="pre">value_type</span></tt> is <tt class="literal"><span class="pre">remove_cv<remove_reference<reference></span> <span class="pre">>::type</span></tt>.</p>
|
||||
<p>The <tt class="literal"><span class="pre">iterator_category</span></tt> member is a type convertible to the iterator
|
||||
tag given 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>
|
||||
<pre class="literal-block">
|
||||
if (reference is a reference to value_type) then
|
||||
if (C is convertible to random_access_traversal_tag) then
|
||||
random_access_iterator_tag
|
||||
else if (C is convertible to bidirectional_traversal_tag) then
|
||||
bidirectional_iterator_tag
|
||||
else
|
||||
forward_iterator_tag
|
||||
else
|
||||
input_iterator_tag
|
||||
</pre>
|
||||
Otherwise, <tt class="literal"><span class="pre">reference</span></tt> is <tt class="literal"><span class="pre">Reference</span></tt>.</p>
|
||||
<p>If <tt class="literal"><span class="pre">Value</span></tt> is <tt class="literal"><span class="pre">use_default</span></tt> then the <tt class="literal"><span class="pre">value_type</span></tt> member is
|
||||
<tt class="literal"><span class="pre">remove_cv<remove_reference<reference></span> <span class="pre">>::type</span></tt>. Otherwise,
|
||||
<tt class="literal"><span class="pre">value_type</span></tt> is <tt class="literal"><span class="pre">Value</span></tt>.</p>
|
||||
<p>If <tt class="literal"><span class="pre">Iterator</span></tt> models Readable Lvalue Iterator and if <tt class="literal"><span class="pre">Iterator</span></tt>
|
||||
models Random Access Traversal Iterator, then <tt class="literal"><span class="pre">iterator_category</span></tt> is
|
||||
convertible to <tt class="literal"><span class="pre">random_access_iterator_tag</span></tt>. Otherwise, if
|
||||
<tt class="literal"><span class="pre">Iterator</span></tt> models Bidirectional Traversal Iterator, then
|
||||
<tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to
|
||||
<tt class="literal"><span class="pre">bidirectional_iterator_tag</span></tt>. Otherwise <tt class="literal"><span class="pre">iterator_category</span></tt> is
|
||||
convertible to <tt class="literal"><span class="pre">forward_iterator_tag</span></tt>. If <tt class="literal"><span class="pre">Iterator</span></tt> does not
|
||||
model Readable Lvalue Iterator then <tt class="literal"><span class="pre">iterator_category</span></tt> is
|
||||
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>
|
||||
@ -2333,7 +2332,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 18:15 UTC.
|
||||
Generated on: 2004-01-13 18:27 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>
|
||||
|
@ -1074,7 +1074,24 @@ c++std-lib-12641:
|
||||
been at this too long, and it's all turning into a maze of twisty passages,
|
||||
all alike.
|
||||
|
||||
:Proposed resolution: **Needs work** (Jeremy)
|
||||
:Proposed resolution:
|
||||
|
||||
Replace:
|
||||
|
||||
The reference type of transform_iterator is
|
||||
``result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type``. The
|
||||
``value_type`` is ``remove_cv<remove_reference<reference> >::type``.
|
||||
|
||||
with:
|
||||
|
||||
If ``Reference`` is ``use_default`` then the ``reference`` member of
|
||||
``transform_iterator`` is
|
||||
``result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type``.
|
||||
Otherwise, ``reference`` is ``Reference``.
|
||||
|
||||
If ``Value`` is ``use_default`` then the ``value_type`` member is
|
||||
``remove_cv<remove_reference<reference> >::type``. Otherwise,
|
||||
``value_type`` is ``Value``.
|
||||
|
||||
|
||||
filter_iterator details unspecified
|
||||
|
@ -88,23 +88,22 @@ private:
|
||||
UnaryFunction m_f; // exposition only
|
||||
};
|
||||
</pre>
|
||||
<p>The <tt class="literal"><span class="pre">reference</span></tt> type of <tt class="literal"><span class="pre">transform_iterator</span></tt> is
|
||||
<p>If <tt class="literal"><span class="pre">Reference</span></tt> is <tt class="literal"><span class="pre">use_default</span></tt> then the <tt class="literal"><span class="pre">reference</span></tt> member of
|
||||
<tt class="literal"><span class="pre">transform_iterator</span></tt> is
|
||||
<tt class="literal"><span class="pre">result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type</span></tt>.
|
||||
The <tt class="literal"><span class="pre">value_type</span></tt> is <tt class="literal"><span class="pre">remove_cv<remove_reference<reference></span> <span class="pre">>::type</span></tt>.</p>
|
||||
<p>The <tt class="literal"><span class="pre">iterator_category</span></tt> member is a type convertible to the iterator
|
||||
tag given 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>
|
||||
<pre class="literal-block">
|
||||
if (reference is a reference to value_type) then
|
||||
if (C is convertible to random_access_traversal_tag) then
|
||||
random_access_iterator_tag
|
||||
else if (C is convertible to bidirectional_traversal_tag) then
|
||||
bidirectional_iterator_tag
|
||||
else
|
||||
forward_iterator_tag
|
||||
else
|
||||
input_iterator_tag
|
||||
</pre>
|
||||
Otherwise, <tt class="literal"><span class="pre">reference</span></tt> is <tt class="literal"><span class="pre">Reference</span></tt>.</p>
|
||||
<p>If <tt class="literal"><span class="pre">Value</span></tt> is <tt class="literal"><span class="pre">use_default</span></tt> then the <tt class="literal"><span class="pre">value_type</span></tt> member is
|
||||
<tt class="literal"><span class="pre">remove_cv<remove_reference<reference></span> <span class="pre">>::type</span></tt>. Otherwise,
|
||||
<tt class="literal"><span class="pre">value_type</span></tt> is <tt class="literal"><span class="pre">Value</span></tt>.</p>
|
||||
<p>If <tt class="literal"><span class="pre">Iterator</span></tt> models Readable Lvalue Iterator and if <tt class="literal"><span class="pre">Iterator</span></tt>
|
||||
models Random Access Traversal Iterator, then <tt class="literal"><span class="pre">iterator_category</span></tt> is
|
||||
convertible to <tt class="literal"><span class="pre">random_access_iterator_tag</span></tt>. Otherwise, if
|
||||
<tt class="literal"><span class="pre">Iterator</span></tt> models Bidirectional Traversal Iterator, then
|
||||
<tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to
|
||||
<tt class="literal"><span class="pre">bidirectional_iterator_tag</span></tt>. Otherwise <tt class="literal"><span class="pre">iterator_category</span></tt> is
|
||||
convertible to <tt class="literal"><span class="pre">forward_iterator_tag</span></tt>. If <tt class="literal"><span class="pre">Iterator</span></tt> does not
|
||||
model Readable Lvalue Iterator then <tt class="literal"><span class="pre">iterator_category</span></tt> is
|
||||
convertible to <tt class="literal"><span class="pre">input_iterator_tag</span></tt>.</p>
|
||||
</div>
|
||||
<div class="section" id="transform-iterator-requirements">
|
||||
<h1><a class="toc-backref" href="#id3" name="transform-iterator-requirements"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></h1>
|
||||
@ -319,7 +318,7 @@ adding 4 to each element in the array:
|
||||
<hr class="footer" />
|
||||
<div class="footer">
|
||||
<a class="reference" href="transform_iterator.rst">View document source</a>.
|
||||
Generated on: 2004-01-13 14:26 UTC.
|
||||
Generated on: 2004-01-13 18:27 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>
|
||||
|
@ -35,27 +35,25 @@
|
||||
};
|
||||
|
||||
|
||||
The ``reference`` type of ``transform_iterator`` is
|
||||
If ``Reference`` is ``use_default`` then the ``reference`` member of
|
||||
``transform_iterator`` is
|
||||
``result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type``.
|
||||
The ``value_type`` is ``remove_cv<remove_reference<reference> >::type``.
|
||||
Otherwise, ``reference`` is ``Reference``.
|
||||
|
||||
The ``iterator_category`` member is a type convertible to the iterator
|
||||
tag given by the following algorithm. Let ``C`` be
|
||||
``traveral_category<Iterator>::type``.
|
||||
|
||||
::
|
||||
|
||||
if (reference is a reference to value_type) then
|
||||
if (C is convertible to random_access_traversal_tag) then
|
||||
random_access_iterator_tag
|
||||
else if (C is convertible to bidirectional_traversal_tag) then
|
||||
bidirectional_iterator_tag
|
||||
else
|
||||
forward_iterator_tag
|
||||
else
|
||||
input_iterator_tag
|
||||
If ``Value`` is ``use_default`` then the ``value_type`` member is
|
||||
``remove_cv<remove_reference<reference> >::type``. Otherwise,
|
||||
``value_type`` is ``Value``.
|
||||
|
||||
|
||||
If ``Iterator`` models Readable Lvalue Iterator and if ``Iterator``
|
||||
models Random Access Traversal Iterator, then ``iterator_category`` is
|
||||
convertible to ``random_access_iterator_tag``. Otherwise, if
|
||||
``Iterator`` models Bidirectional Traversal Iterator, then
|
||||
``iterator_category`` is convertible to
|
||||
``bidirectional_iterator_tag``. Otherwise ``iterator_category`` is
|
||||
convertible to ``forward_iterator_tag``. If ``Iterator`` does not
|
||||
model Readable Lvalue Iterator then ``iterator_category`` is
|
||||
convertible to ``input_iterator_tag``.
|
||||
|
||||
|
||||
``transform_iterator`` requirements
|
||||
|
Reference in New Issue
Block a user