Boost C++ Libraries: Ticket #1887: [doc] input_iterator_archetype is not a valid InputIterator https://svn.boost.org/trac10/ticket/1887 <p> creating_concepts.htm shows an <a class="missing wiki">InputIterator</a> concept which requires that the type of *it++ is the same as the value_type. (This is legit according to the C++03 requirements table for input iterators, but probably too strict in practice.) Then, concept_covering.htm shows an input_iterator_archetype, which fails to meet this requirement because *it++ will return an object of type input_iterator_archetype::reference which is distinct from, but convertible to, the iterator's value_type. If you try to assert that input_iterator_archetype satisfies the <a class="missing wiki">InputIterator</a> concepts as both are presented in the docs, it will fail. </p> <p> This is only a documentation problem. As defined by the BCCL, input_iterator_archetype is a valid <a class="missing wiki">InputIterator</a>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1887 Trac 1.4.3 Dave Abrahams Thu, 01 May 2008 19:42:49 GMT status changed https://svn.boost.org/trac10/ticket/1887#comment:1 https://svn.boost.org/trac10/ticket/1887#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Dave Abrahams Sat, 28 Nov 2009 17:35:04 GMT <link>https://svn.boost.org/trac10/ticket/1887#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1887#comment:2</guid> <description> <p> There may be a problem, but it's not quite what you said. Table 72 quite clearly says that the type of *r++ is T, the iterator's value_type. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Sat, 28 Nov 2009 17:45:23 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/1887#comment:3 https://svn.boost.org/trac10/ticket/1887#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Dave Abrahams</span> to <span class="trac-author">Eric Niebler</span> </li> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> </ul> <p> Well, there's probably a bug in the C++03 standard here. What it actually says, if you read carefully enough, is that <code>*a</code> is required to be convertible to <code>T</code>—where <code>a</code> is any value of type <code>X</code>, the iterator type)—but <code>*r++</code> is required to be exactly <code>T</code>, where <code>r</code> is of type <code>X&amp;</code>. I'm guessing the strictly correct thing to do in the archetype is something like this: </p> <div class="wiki-code"><div class="code"><pre> <span class="n">T</span> <span class="k">operator</span><span class="o">*</span><span class="p">();</span> <span class="n">reference</span> <span class="k">operator</span><span class="o">*</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span> </pre></div></div><p> Your thoughts? </p> Ticket Eric Niebler Tue, 20 Sep 2011 19:13:25 GMT attachment set https://svn.boost.org/trac10/ticket/1887 https://svn.boost.org/trac10/ticket/1887 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">creating_concepts.patch</span> </li> </ul> Ticket Eric Niebler Tue, 20 Sep 2011 19:15:01 GMT owner changed https://svn.boost.org/trac10/ticket/1887#comment:4 https://svn.boost.org/trac10/ticket/1887#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Eric Niebler</span> to <span class="trac-author">Dave Abrahams</span> </li> </ul> <p> The bug in the standard has been fixed in C++11. Both <code>*a</code> and <code>*i++</code> are merely required to convert something convertible to <code>T</code>. So the <code>input_iterator_archetype</code> is correct, and only the docs are wrong. I've attached a patch. </p> Ticket