Boost C++ Libraries: Ticket #3358: return type of functions incorrect https://svn.boost.org/trac10/ticket/3358 <p> maybe only documented incorrectly, but given the error messages it still takes a few years to figure that out. </p> <p> e.g. push_back, documented as: typename result_of::push_back&lt;Sequence, T&gt;::type push_back( </p> <blockquote> <p> Sequence const&amp; seq, T const&amp; t); </p> </blockquote> <p> when it's actually typename result_of::push_back&lt;Sequence const, T&gt;::type </p> <blockquote> <p> push_back(Sequence const&amp; seq, T const&amp; x) </p> </blockquote> <p> note the const. I'm not sure why the const is there, but if it is really intended that: result_of::push_back&lt;seq_t,int&gt;::type res=push_back(seq,4); should result in an error, this should be a major part of the documentation. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3358 Trac 1.4.3 Steven Watanabe Wed, 19 Aug 2009 22:35:48 GMT <link>https://svn.boost.org/trac10/ticket/3358#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3358#comment:1</guid> <description> <p> Actually, I think it would be better if fusion::push_back were overloaded to allow either const or non-const arguments, like </p> <pre class="wiki"> template &lt;typename Sequence, typename T&gt; inline typename result_of::push_back&lt;Sequence, T&gt;::type push_back(Sequence &amp; seq, T const&amp; x); template &lt;typename Sequence, typename T&gt; inline typename result_of::push_back&lt;Sequence const, T&gt;::type push_back(Sequence const&amp; seq, T const&amp; x); </pre><p> Regardless, result_of::push_back ought to work correctly for non-const arguments. If push_back always adds const, then so should result_of::push_back. </p> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Mon, 05 Oct 2015 23:42:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3358#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3358#comment:2</guid> <description> <p> Fixed by <a class="ext-link" href="https://github.com/boostorg/fusion/pull/106"><span class="icon">​</span>https://github.com/boostorg/fusion/pull/106</a> . </p> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3358#comment:1" title="Comment 1">steven_watanabe</a>: </p> <blockquote class="citation"> <p> Actually, I think it would be better if fusion::push_back were overloaded to allow either const or non-const arguments, like </p> <pre class="wiki"> template &lt;typename Sequence, typename T&gt; inline typename result_of::push_back&lt;Sequence, T&gt;::type push_back(Sequence &amp; seq, T const&amp; x); template &lt;typename Sequence, typename T&gt; inline typename result_of::push_back&lt;Sequence const, T&gt;::type push_back(Sequence const&amp; seq, T const&amp; x); </pre></blockquote> <p> It will be handled in <a class="new ticket" href="https://svn.boost.org/trac10/ticket/3954" title="#3954: Bugs: fusion algorithms must be overloaded for const and non-const arguments (new)">#3954</a>. </p> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Tue, 10 Nov 2015 01:28:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3358#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3358#comment:3</guid> <description> <p> Joel, could you close this ticket? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Tue, 10 Nov 2015 02:15:22 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3358#comment:4 https://svn.boost.org/trac10/ticket/3358#comment:4 <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