Boost C++ Libraries: Ticket #1019: iterator_facade::pointer should be the return type of operator-> (DR 445) https://svn.boost.org/trac10/ticket/1019 <p> The definition of iterator_facade does not agree with the resolution of Standard Library Defect Report 445, submitted by David Abrahams, 2003-12-09. <br /> <a class="ext-link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#445"><span class="icon">​</span>http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#445</a> </p> <p> DR 445 is resolved within the current Draft of the Standard, as follows (Iterator traits, section 24.3.1):<br /> <em> iterator_traits&lt;Iterator&gt;::reference </em> <br /> <em> iterator_traits&lt;Iterator&gt;::pointer </em> <br /> <em>shall be defined as the iterator’s reference and pointer types, that is, for an iterator object a, the same type as the type of *a and a-&gt;, respectively.</em> <br /> <a class="ext-link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2135.pdf"><span class="icon">​</span>http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2135.pdf</a> </p> <p> On the other hand, iterator_facade::pointer is a raw pointer, while iterator_facade::operator-&gt;() returns operator_arrow_result::type, which may be a proxy. </p> <p> To conform to the resolution of DR 445, iterator_facade::pointer should be defined as the return type of operator-&gt;(), e.g. (assuming that <em>raw_pointer</em> is the original raw pointer to the value_type): </p> <pre class="wiki"> typedef typename operator_arrow_result&lt; value_type , reference , raw_pointer &gt;::type pointer; </pre><p> More discussion about this issue: </p> <p> comp.lang.c++.moderated, Sep 29 2005 <br /> Re: iterator dereference requirements <br /> <a class="ext-link" href="http://groups.google.com/group/comp.lang.c++.moderated/msg/0f332bcd9a911526"><span class="icon">​</span>http://groups.google.com/group/comp.lang.c++.moderated/msg/0f332bcd9a911526</a> </p> <p> comp.std.c++, <a class="missing wiki">March/April</a> 2007 <br /> What should std::<a class="missing wiki">InputIterator</a>&lt;T&gt;::pointer be? [n2193 / n2083] <br /> <a class="ext-link" href="http://groups.google.com/groups/search?q=%22What+should+std%3A%3AInputIterator%3CT%3E%3A%3Apointer+be%3F%22"><span class="icon">​</span>http://groups.google.com/groups/search?q=%22What+should+std%3A%3AInputIterator%3CT%3E%3A%3Apointer+be%3F%22</a> </p> <p> comp.std.c++, May 2007 <br /> Testing new iterator concepts with ConceptGCC <br /> <a class="ext-link" href="http://groups.google.com/group/comp.std.c++/tree/browse_frm/thread/9c40ffc2f6394ca0/590e75dfbb993cf6"><span class="icon">​</span>http://groups.google.com/group/comp.std.c++/tree/browse_frm/thread/9c40ffc2f6394ca0/590e75dfbb993cf6</a> </p> <p> [I had some e-mail discussion with David Abrahams on this issue as well.] </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1019 Trac 1.4.3 Thomas Witt Thu, 31 May 2007 00:14:36 GMT milestone changed https://svn.boost.org/trac10/ticket/1019#comment:1 https://svn.boost.org/trac10/ticket/1019#comment:1 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.34.1</span> → <span class="trac-field-new">Boost 1.35.0</span> </li> </ul> <p> Did not make the deadline. </p> Ticket Eric Niebler Wed, 11 Jul 2007 01:55:57 GMT owner set https://svn.boost.org/trac10/ticket/1019#comment:2 https://svn.boost.org/trac10/ticket/1019#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Dave Abrahams</span> </li> </ul> Ticket Dave Abrahams Thu, 26 Jun 2008 20:49:36 GMT status changed https://svn.boost.org/trac10/ticket/1019#comment:3 https://svn.boost.org/trac10/ticket/1019#comment:3 <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 05:12:31 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1019#comment:4 https://svn.boost.org/trac10/ticket/1019#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/57989" title="Made sure that iterator_facade's nested ``::pointer`` type is always ...">[57989]</a>) Made sure that iterator_facade's nested <code></code>::pointer<code></code> type is always the same as what's returned from operator-&gt;. For input iterators, that wasn't always the case (see operator_arrow_proxy). </p> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1019" title="#1019: Bugs: iterator_facade::pointer should be the return type of operator-&gt; (DR 445) (closed: fixed)">#1019</a>. </p> Ticket