Boost C++ Libraries: Ticket #5697: iterator_facade::operator-> is broken for proxy references https://svn.boost.org/trac10/ticket/5697 <p> For the detailed discussion: </p> <p> <a class="ext-link" href="http://comments.gmane.org/gmane.comp.lib.boost.devel/221041"><span class="icon">​</span>http://comments.gmane.org/gmane.comp.lib.boost.devel/221041</a> </p> <p> Briefly, when using a proxy reference in one's iterator derived from iterator_facade, the implementation of operator-&gt; tries to construct a value_type const * from the expression &amp;x, where x has (declared) type reference. I see no reason why a reference* (a pointer to a proxy reference object) could be expected to be a convertible to a value_type const *. I believe a correct implementation of operator_arrow_proxy would store the proxy reference object, not an object of the value_type. As far as I know, this does not violate any iterator requirements. </p> <p> I will gladly submit a patch once it is acknowledged that this is, indeed, a bug (or before, if requested). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5697 Trac 1.4.3 Dave Abrahams Thu, 14 Jul 2011 20:26:11 GMT <link>https://svn.boost.org/trac10/ticket/5697#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:1</guid> <description> <p> Please do submit a patch; that will make the report much easier to evaluate. </p> <p> Thanks! </p> </description> <category>Ticket</category> </item> <item> <author>Jeffrey Hellrung <jeffrey.hellrung@…></author> <pubDate>Fri, 15 Jul 2011 01:15:07 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5697 https://svn.boost.org/trac10/ticket/5697 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">iterator_facade.patch.hpp</span> </li> </ul> Ticket Jeffrey Hellrung <jeffrey.hellrung@…> Fri, 15 Jul 2011 01:18:12 GMT <link>https://svn.boost.org/trac10/ticket/5697#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:2</guid> <description> <p> I'm a novice at creating patches; hopefully iterator_facade.patch.hpp is sufficient, and if not, let me know. I changed iterator_facade as indicated in the patch and, at least, everything built correctly. If you want, I can try figuring out how to run the Boost.Iterator tests and verify that they all pass (or not). </p> </description> <category>Ticket</category> </item> <item> <author>Jeffrey Hellrung <jeffrey.hellrung@…></author> <pubDate>Fri, 15 Jul 2011 01:19:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:3</guid> <description> <p> "built correctly" == "without compiler errors" :/ </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Fri, 15 Jul 2011 01:33:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:4</guid> <description> <p> please run bjam in libs/iterator/test under BOOST_ROOT and see if any tests fail. </p> </description> <category>Ticket</category> </item> <item> <author>Jeffrey Hellrung <jeffrey.hellrung@…></author> <pubDate>Fri, 15 Jul 2011 03:12:52 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5697 https://svn.boost.org/trac10/ticket/5697 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">iterator_facade.patch.2.hpp</span> </li> </ul> Ticket Jeffrey Hellrung <jeffrey.hellrung@…> Fri, 15 Jul 2011 03:21:01 GMT <link>https://svn.boost.org/trac10/ticket/5697#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:5</guid> <description> <p> Okay, I ran the iterator tests, and iterator_facade.cpp failed to compile at line 107, "p-&gt;mutator();". To get that line to compile (and the test to pass), I removed some consts from the operator_arrow_dispatch::proxy, as shown in the second attachment (iterator_facade.patch.2.hpp). Looks like all iterator tests pass now, but I'm not really sure if the consts would be necessary on other compilers (I'm using MSVC9 on Windows 7). Let me know what you think when you get a chance (and thanks for looking at this with me!). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Fri, 15 Jul 2011 23:44:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:6</guid> <description> <p> (minor detail: next time make the attachments end with .patch instead of .hpp and they will render as patches.) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Fri, 15 Jul 2011 23:54:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:7</guid> <description> <p> Your patch looks excellent. I don't think there's any reason to use implicit_cast in there, though. At this point, it should just be </p> <pre class="wiki">return boost::addressof(x); </pre><p> If you can fix that, and add a test case that fails without your patch and passes otherwise, I'll be happy to commit this. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 16 Jul 2011 00:16:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:8</guid> <description> <p> Agreed on both accounts; I was just trying to maintain the same style as before. </p> <p> I will change the patch accordingly (with a .patch extension) and add a test case to...iterator_facade.cpp, I suppose? </p> </description> <category>Ticket</category> </item> <item> <author>Jeffrey Hellrung <jeffrey.hellrung@…></author> <pubDate>Sun, 17 Jul 2011 03:37:41 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5697 https://svn.boost.org/trac10/ticket/5697 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">iterator_facade.hpp.patch</span> </li> </ul> Ticket Jeffrey Hellrung <jeffrey.hellrung@…> Sun, 17 Jul 2011 03:42:26 GMT <link>https://svn.boost.org/trac10/ticket/5697#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:9</guid> <description> <p> I have uploaded a patch for iterator_facade.hpp, but I'm having issues uploading a patch for iterator_facade.cpp (from libs/iterator/test). The spam filter keeps thinking I'm uploading spam :( I guess I will email the attachment directly to you, Dave, and if it gets lost in the shuffle, I can try uploading again... </p> <p> The test fails for the present version of iterator_facade with </p> <p> compile-c-c++ ..\..\..\bin.v2\libs\iterator\test\iterator_facade.test\msvc-9.0\debug\threading-multi\iterator_facade.obj iterator_facade.cpp D:\boost_1_47_0\boost/iterator/iterator_facade.hpp(327) : error C2664: 'boost::implicit_cast' : cannot convert parameter 1 from 'wrapper&lt;T&gt; *' to 'boost::detail::operator_arrow_proxy&lt;T&gt;' </p> <blockquote> <p> with [ </p> <blockquote> <p> T=int &amp; </p> </blockquote> <p> ] and [ </p> <blockquote> <p> T=wrapper&lt;int&gt; </p> </blockquote> <p> ] No constructor could take the source type, or constructor overload resolution was ambiguous </p> </blockquote> <p> ...as expected. </p> </description> <category>Ticket</category> </item> <item> <author>Jeffrey Hellrung <jeffrey.hellrung@…></author> <pubDate>Mon, 18 Jul 2011 03:37:22 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5697 https://svn.boost.org/trac10/ticket/5697 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">iterator_facade.cpp.patch</span> </li> </ul> Ticket Jeffrey Hellrung <jeffrey.hellrung@…> Sun, 07 Aug 2011 02:41:19 GMT <link>https://svn.boost.org/trac10/ticket/5697#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:10</guid> <description> <p> :: ping :: </p> <p> How likely will this sneak into 1.48? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 02 Nov 2011 13:23:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:11</guid> <description> <p> Jeff, is this earlier thread describing the same problem? </p> <blockquote> <p> <a class="ext-link" href="http://thread.gmane.org/gmane.comp.lib.boost.devel/198562"><span class="icon">​</span>http://thread.gmane.org/gmane.comp.lib.boost.devel/198562</a> </p> </blockquote> </description> <category>Ticket</category> </item> <item> <author>Jeffrey Lee Hellrung, Jr. <jeffrey.hellrung@…></author> <pubDate>Wed, 02 Nov 2011 16:40:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:12</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5697#comment:11" title="Comment 11">anonymous</a>: </p> <blockquote class="citation"> <p> Jeff, is this earlier thread describing the same problem? </p> <blockquote> <p> <a class="ext-link" href="http://thread.gmane.org/gmane.comp.lib.boost.devel/198562"><span class="icon">​</span>http://thread.gmane.org/gmane.comp.lib.boost.devel/198562</a> </p> </blockquote> </blockquote> <p> I believe so. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Sat, 31 Mar 2012 23:39:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:13</guid> <description> <p> I think that bug <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4313" title="#4313: Bugs: operator_arrow_result should use Reference instead of ValueType in ... (closed: duplicate)">#4313</a> is reporting the same issue as well, and also has a patch. Should I close that one as a duplicate now? </p> </description> <category>Ticket</category> </item> <item> <author>Jeffrey Lee Hellrung, Jr. <jeffrey.hellrung@…></author> <pubDate>Mon, 02 Apr 2012 17:45:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:14</guid> <description> <p> Looks like it, so yes, you should probably close <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4313" title="#4313: Bugs: operator_arrow_result should use Reference instead of ValueType in ... (closed: duplicate)">#4313</a> as duplicate. Feel free to apply the attached patches, although I'm hoping to have some free time in the coming months to actually learn the development process and get this and other Iterator tickets taken care of. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Mon, 02 Apr 2012 18:02:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:15 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:15</guid> <description> <p> Which of the patches would you like me to apply? One of them from this ticket or the one from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4313" title="#4313: Bugs: operator_arrow_result should use Reference instead of ValueType in ... (closed: duplicate)">#4313</a>? I'll go ahead and close <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4313" title="#4313: Bugs: operator_arrow_result should use Reference instead of ValueType in ... (closed: duplicate)">#4313</a> anyway. </p> </description> <category>Ticket</category> </item> <item> <author>Jeffrey Lee Hellrung, Jr. <jeffrey.hellrung@…></author> <pubDate>Mon, 02 Apr 2012 18:14:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:16</guid> <description> <p> If willing, please apply iterator_facade.*pp.patch from this ticket (the latter 2 patches). I believe they are more complete than the patch provided in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4313" title="#4313: Bugs: operator_arrow_result should use Reference instead of ValueType in ... (closed: duplicate)">#4313</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Mon, 02 Apr 2012 18:19:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:17 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:17</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/77723" title="Applied patches from #5697; refs #5697">[77723]</a>) Applied patches from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5697" title="#5697: Bugs: iterator_facade::operator-&gt; is broken for proxy references (closed: fixed)">#5697</a>; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5697" title="#5697: Bugs: iterator_facade::operator-&gt; is broken for proxy references (closed: fixed)">#5697</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Mon, 02 Apr 2012 18:21:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:18 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:18</guid> <description> <p> I've applied the patches you wanted -- please close the bug if you think it works now. </p> </description> <category>Ticket</category> </item> <item> <author>Jeffrey Lee Hellrung, Jr. <jeffrey.hellrung@…></author> <pubDate>Mon, 02 Apr 2012 18:24:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5697#comment:19 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:19</guid> <description> <p> Awesome, thanks. Once I reset my SVN password (::sigh::) I'll review the test result matrix and close this ticket. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>jeffrey.hellrung</dc:creator> <pubDate>Tue, 17 Apr 2012 14:35:03 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5697#comment:20 https://svn.boost.org/trac10/ticket/5697#comment:20 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket jeffrey.hellrung Tue, 24 Apr 2012 21:28:14 GMT <link>https://svn.boost.org/trac10/ticket/5697#comment:21 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5697#comment:21</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/78184" title="merging from trunk; fix #5127 from M. Morin; fix for refs #5697">[78184]</a>) merging from trunk; fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5127" title="#5127: Patches: Incorrect result_of usage in transform_iterator (closed: fixed)">#5127</a> from M. Morin; fix for refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5697" title="#5697: Bugs: iterator_facade::operator-&gt; is broken for proxy references (closed: fixed)">#5697</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>