Boost C++ Libraries: Ticket #11563: boost::range behavior changed from 1.55 to 1.56 https://svn.boost.org/trac10/ticket/11563 <p> The following code sums up the problem, I think neither the behavior of &lt;= 1.55 nor the one of &gt;= 1.56 is desirable: </p> <pre class="wiki">#include &lt;boost/range/join.hpp&gt; #include &lt;iostream&gt; #include &lt;vector&gt; template &lt;typename T&gt; void p(T const&amp; t) { for(const auto i: t) { std::cout &lt;&lt; i &lt;&lt; '\n'; } } int main() { std::vector&lt;int&gt; u(8, 0); // Make this const and it works. const std::vector&lt;int&gt; v(8, 0); p(boost::range::join(v, u)); // This does not work &lt;= 1.55 but works &gt;= 1.56 p(boost::range::join(u, v)); // This does not work &gt;= 1.56 but works &lt;= 1.55 return 0; } </pre><p> Also see <a class="ext-link" href="http://melpon.org/wandbox/permlink/QuyJGrrLq3liyKDf"><span class="icon">​</span>http://melpon.org/wandbox/permlink/QuyJGrrLq3liyKDf</a> for easier trial and error. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11563 Trac 1.4.3 Michel Morin Fri, 21 Aug 2015 12:48:54 GMT <link>https://svn.boost.org/trac10/ticket/11563#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11563#comment:1</guid> <description> <p> Thanks for the report! </p> <p> These behaviors were fixed in <a class="changeset" href="https://svn.boost.org/trac10/changeset/85400" title="[range] Fixed a bug in join_iterator where joining a const range and a ...">r85400</a> (i.e. the fix of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8483" title="#8483: Bugs: Fix for reference type deduction in join_iterator.hpp (closed: fixed)">#8483</a> -- Fix for reference type deduction in join_iterator.hpp), but the fix was (accidentally?) reverted in <a class="changeset" href="https://svn.boost.org/trac10/changeset/85691" title="[boost][range] - changed join_iterator reference type handling to ...">r85691</a>. I suspect that the intention of <a class="changeset" href="https://svn.boost.org/trac10/changeset/85691" title="[boost][range] - changed join_iterator reference type handling to ...">r85691</a> would be to change </p> <pre class="wiki"> typename add_reference&lt; typename add_const&lt; typename remove_reference&lt; typename iterator_reference&lt;Iterator2&gt;::type &gt;::type &gt;::type &gt;::type </pre><p> to </p> <pre class="wiki"> typename add_reference&lt; typename add_const&lt; typename remove_reference&lt; typename iterator_reference&lt;Iterator1&gt;::type &gt;::type &gt;::type &gt;::type </pre><p> I made a <a class="ext-link" href="https://github.com/boostorg/range/pull/36"><span class="icon">​</span>PR</a> on github. </p> </description> <category>Ticket</category> </item> </channel> </rss>