mirror of
https://github.com/boostorg/iterator.git
synced 2025-05-09 23:23:54 +00:00
Merged from 1.33.0 release
[SVN r30540]
This commit is contained in:
parent
55fd9078a1
commit
6363297754
@ -26,7 +26,7 @@
|
||||
Lab</a>, <a class="last reference" href="http://www.styleadvisor.com">Zephyr Associates, Inc.</a></td></tr>
|
||||
<tr><th class="docinfo-name">Date:</th>
|
||||
<td>2004-11-01</td></tr>
|
||||
<tr class="field"><th class="docinfo-name">Number:</th><td class="field-body">This is a revised version of <a class="reference" href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1530.html">N1530</a>=03-0113, which was
|
||||
<tr class="field"><th class="docinfo-name">Number:</th><td class="field-body">This is a revised version of <a class="reference" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1530.html">N1530</a>=03-0113, which was
|
||||
accepted for Technical Report 1 by the C++ standard
|
||||
committee's library working group.</td>
|
||||
</tr>
|
||||
@ -235,12 +235,12 @@ Iterator Concepts.</p>
|
||||
<div class="section" id="iterator-concepts">
|
||||
<h2><a class="toc-backref" href="#id18" name="iterator-concepts">Iterator Concepts</a></h2>
|
||||
<p>This proposal is formulated in terms of the new <tt class="docutils literal"><span class="pre">iterator</span> <span class="pre">concepts</span></tt>
|
||||
as proposed in <a class="reference" href="http://anubis.dkuug.dk/JTC1/SC22/WG21/docs/papers/2003/n1550.html">n1550</a>, since user-defined and especially adapted
|
||||
as proposed in <a class="reference" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1550.htm">n1550</a>, since user-defined and especially adapted
|
||||
iterators suffer from the well known categorization problems that are
|
||||
inherent to the current iterator categories.</p>
|
||||
<p>This proposal does not strictly depend on proposal <a class="reference" href="http://anubis.dkuug.dk/JTC1/SC22/WG21/docs/papers/2003/n1550.html">n1550</a>, as there
|
||||
<p>This proposal does not strictly depend on proposal <a class="reference" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1550.htm">n1550</a>, as there
|
||||
is a direct mapping between new and old categories. This proposal
|
||||
could be reformulated using this mapping if <a class="reference" href="http://anubis.dkuug.dk/JTC1/SC22/WG21/docs/papers/2003/n1550.html">n1550</a> was not accepted.</p>
|
||||
could be reformulated using this mapping if <a class="reference" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1550.htm">n1550</a> was not accepted.</p>
|
||||
</div>
|
||||
<div class="section" id="interoperability">
|
||||
<h2><a class="toc-backref" href="#id19" name="interoperability">Interoperability</a></h2>
|
||||
@ -416,7 +416,7 @@ into the temporary iterator <tt class="docutils literal"><span class="pre">p+n</
|
||||
<tt class="docutils literal"><span class="pre">operator[]</span></tt> returns.</p>
|
||||
<p>Writable iterators built with <tt class="docutils literal"><span class="pre">iterator_facade</span></tt> implement the
|
||||
semantics required by the preferred resolution to <a class="reference" href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#299">issue 299</a> and
|
||||
adopted by proposal <a class="reference" href="http://anubis.dkuug.dk/JTC1/SC22/WG21/docs/papers/2003/n1550.html">n1550</a>: the result of <tt class="docutils literal"><span class="pre">p[n]</span></tt> is an object
|
||||
adopted by proposal <a class="reference" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1550.htm">n1550</a>: the result of <tt class="docutils literal"><span class="pre">p[n]</span></tt> is an object
|
||||
convertible to the iterator's <tt class="docutils literal"><span class="pre">value_type</span></tt>, and <tt class="docutils literal"><span class="pre">p[n]</span> <span class="pre">=</span> <span class="pre">x</span></tt> is
|
||||
equivalent to <tt class="docutils literal"><span class="pre">*(p</span> <span class="pre">+</span> <span class="pre">n)</span> <span class="pre">=</span> <span class="pre">x</span></tt> (Note: This result object may be
|
||||
implemented as a proxy containing a copy of <tt class="docutils literal"><span class="pre">p+n</span></tt>). This approach
|
||||
|
@ -234,7 +234,7 @@ into the temporary iterator <tt class="docutils literal"><span class="pre">p+n</
|
||||
<tt class="docutils literal"><span class="pre">operator[]</span></tt> returns.</p>
|
||||
<p>Writable iterators built with <tt class="docutils literal"><span class="pre">iterator_facade</span></tt> implement the
|
||||
semantics required by the preferred resolution to <a class="reference" href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#299">issue 299</a> and
|
||||
adopted by proposal <a class="reference" href="http://anubis.dkuug.dk/JTC1/SC22/WG21/docs/papers/2003/n1550.html">n1550</a>: the result of <tt class="docutils literal"><span class="pre">p[n]</span></tt> is an object
|
||||
adopted by proposal <a class="reference" href="http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2003/n1550.htm">n1550</a>: the result of <tt class="docutils literal"><span class="pre">p[n]</span></tt> is an object
|
||||
convertible to the iterator's <tt class="docutils literal"><span class="pre">value_type</span></tt>, and <tt class="docutils literal"><span class="pre">p[n]</span> <span class="pre">=</span> <span class="pre">x</span></tt> is
|
||||
equivalent to <tt class="docutils literal"><span class="pre">*(p</span> <span class="pre">+</span> <span class="pre">n)</span> <span class="pre">=</span> <span class="pre">x</span></tt> (Note: This result object may be
|
||||
implemented as a proxy containing a copy of <tt class="docutils literal"><span class="pre">p+n</span></tt>). This approach
|
||||
@ -1269,8 +1269,8 @@ If we try to convert from <tt class="docutils literal"><span class="pre">node_co
|
||||
constructor tries to initialize <tt class="docutils literal"><span class="pre">node_iterator</span></tt>'s <tt class="docutils literal"><span class="pre">m_node</span></tt>, a
|
||||
<tt class="docutils literal"><span class="pre">node*</span></tt> with a <tt class="docutils literal"><span class="pre">node</span> <span class="pre">const*</span></tt>. So what's the problem?</p>
|
||||
<p>The problem is that
|
||||
<tt class="docutils literal"><span class="pre">boost::</span></tt><a class="reference" href="../../type_traits/index.html#relationships"><tt class="docutils literal"><span class="pre">is_convertible</span></tt></a><tt class="docutils literal"><span class="pre"><node_const_iterator,node_iterator>::value</span></tt>
|
||||
will be <tt class="docutils literal"><span class="pre">true</span></tt>, but it should be <tt class="docutils literal"><span class="pre">false</span></tt>. <a class="reference" href="../../type_traits/index.html#relationships"><tt class="docutils literal"><span class="pre">is_convertible</span></tt></a>
|
||||
<tt class="docutils literal"><span class="pre">boost::</span></tt><a class="reference" href="../../../doc/html/boost_typetraits/category.html#boost_typetraits.relate"><tt class="docutils literal"><span class="pre">is_convertible</span></tt></a><tt class="docutils literal"><span class="pre"><node_const_iterator,node_iterator>::value</span></tt>
|
||||
will be <tt class="docutils literal"><span class="pre">true</span></tt>, but it should be <tt class="docutils literal"><span class="pre">false</span></tt>. <a class="reference" href="../../../doc/html/boost_typetraits/category.html#boost_typetraits.relate"><tt class="docutils literal"><span class="pre">is_convertible</span></tt></a>
|
||||
lies because it can only see as far as the <em>declaration</em> of
|
||||
<tt class="docutils literal"><span class="pre">node_iter</span></tt>'s converting constructor, but can't look inside at
|
||||
the <em>definition</em> to make sure it will compile. A perfect solution
|
||||
|
@ -36,7 +36,7 @@
|
||||
<tbody valign="top">
|
||||
<tr class="field"><th class="field-name">abstract:</th><td class="field-body">Header <tt class="docutils literal"><span class="pre"><boost/iterator/iterator_traits.hpp></span></tt> provides
|
||||
the ability to access an iterator's associated types using
|
||||
MPL-compatible <a class="reference" href="../../mpl/doc/index.html#metafunctions">metafunctions</a>.</td>
|
||||
MPL-compatible <a class="reference" href="../../mpl/doc/refmanual/metafunction.html">metafunctions</a>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -47,7 +47,7 @@ of any iterator: its <tt class="docutils literal"><span class="pre">value_type</
|
||||
<tt class="docutils literal"><span class="pre">iterator_category</span></tt>, and <tt class="docutils literal"><span class="pre">difference_type</span></tt>. Unfortunately,
|
||||
such a "multi-valued" traits template can be difficult to use in a
|
||||
metaprogramming context. <tt class="docutils literal"><span class="pre"><boost/iterator/iterator_traits.hpp></span></tt>
|
||||
provides access to these types using a standard <a class="reference" href="../../mpl/doc/index.html#metafunctions">metafunctions</a>.</p>
|
||||
provides access to these types using a standard <a class="reference" href="../../mpl/doc/refmanual/metafunction.html">metafunctions</a>.</p>
|
||||
</div>
|
||||
<div class="section" id="summary">
|
||||
<h1><a name="summary">Summary</a></h1>
|
||||
@ -98,11 +98,11 @@ struct iterator_category
|
||||
<div class="section" id="broken-compiler-notes">
|
||||
<h1><a name="broken-compiler-notes">Broken Compiler Notes</a></h1>
|
||||
<p>Because of workarounds in Boost, you may find that these
|
||||
<a class="reference" href="../../mpl/doc/index.html#metafunctions">metafunctions</a> actually work better than the facilities provided by
|
||||
<a class="reference" href="../../mpl/doc/refmanual/metafunction.html">metafunctions</a> actually work better than the facilities provided by
|
||||
your compiler's standard library.</p>
|
||||
<p>On compilers that don't support partial specialization, such as
|
||||
Microsoft Visual C++ 6.0 or 7.0, you may need to manually invoke
|
||||
<a class="reference" href="../../type_traits/index.html#transformations">BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION</a> on the
|
||||
<a class="reference" href="../../../doc/html/boost_typetraits/category.html#boost_typetraits.transform">BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION</a> on the
|
||||
<tt class="docutils literal"><span class="pre">value_type</span></tt> of pointers that are passed to these metafunctions.</p>
|
||||
<p>Because of bugs in the implementation of GCC-2.9x, the name of
|
||||
<tt class="docutils literal"><span class="pre">iterator_category</span></tt> is changed to <tt class="docutils literal"><span class="pre">iterator_category_</span></tt> on that
|
||||
|
@ -27,7 +27,7 @@
|
||||
Lab</a>, <a class="last reference" href="http://www.styleadvisor.com">Zephyr Associates, Inc.</a></td></tr>
|
||||
<tr><th class="docinfo-name">Date:</th>
|
||||
<td>2004-11-01</td></tr>
|
||||
<tr class="field"><th class="docinfo-name">Number:</th><td class="field-body">This is a revised version of <a class="reference" href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1550.html">n1550</a>=03-0133, which was
|
||||
<tr class="field"><th class="docinfo-name">Number:</th><td class="field-body">This is a revised version of <a class="reference" href="http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2003/n1550.htm">n1550</a>=03-0133, which was
|
||||
accepted for Technical Report 1 by the C++ standard
|
||||
committee's library working group. This proposal is a
|
||||
revision of paper <a class="reference" href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2001/n1297.html">n1297</a>, <a class="reference" href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1477.html">n1477</a>, and <a class="reference" href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1531.html">n1531</a>.</td>
|
||||
@ -146,7 +146,7 @@ In paragraph 23.2.4/1 it says that a <tt class="docutils literal"><span class="p
|
||||
supports random access iterators.</p>
|
||||
<p>Another difficult-to-categorize iterator is the transform iterator, an
|
||||
adaptor which applies a unary function object to the dereferenced
|
||||
value of the some underlying iterator (see <a class="reference" href="http://www.boost.org/libs/utility/transform_iterator.htm">transform_iterator</a>).
|
||||
value of the some underlying iterator (see <a class="reference" href="http://www.boost.org/libs/iterator/doc/transform_iterator.html">transform_iterator</a>).
|
||||
For unary functions such as <tt class="docutils literal"><span class="pre">times</span></tt>, the return type of
|
||||
<tt class="docutils literal"><span class="pre">operator*</span></tt> clearly needs to be the <tt class="docutils literal"><span class="pre">result_type</span></tt> of the function
|
||||
object, which is typically not a reference. Because random access
|
||||
|
Loading…
x
Reference in New Issue
Block a user