Boost C++ Libraries: Ticket #11985: range: compiler-error sub_range copy-constructor workaround for MSVC https://svn.boost.org/trac10/ticket/11985 <p> Hi, </p> <p> the following code generates an error when compiled with MSVC 11 (aka VS 2012) </p> <pre class="wiki"> std::vector&lt;int&gt; arr; arr.push_back(42); boost::sub_range&lt;std::vector&lt;int&gt;&gt; ran = arr; boost::sub_range&lt;std::vector&lt;int&gt;&gt; ran_2 = ran; const boost::sub_range&lt;std::vector&lt;int&gt;&gt;&amp; ran_ref = ran; boost::sub_range&lt;std::vector&lt;int&gt;&gt; ran_3 = ran_ref; </pre><p> Error: libs\boost\boost\boost\range\iterator_range_core.hpp(69): error C2440: 'static_cast' : cannot convert from 'std::_Vector_const_iterator&lt;_Myvec&gt;' to 'std::_Vector_iterator&lt;_Myvec&gt;' </p> <p> the reason is a BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500) ) in boost/range/sub_range.hpp at line 183 if I comment out the workaround everything compiles correct. </p> <p> Tobias </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11985 Trac 1.4.3 Tobias Loew Mon, 15 Feb 2016 09:32:48 GMT description changed https://svn.boost.org/trac10/ticket/11985#comment:1 https://svn.boost.org/trac10/ticket/11985#comment:1 <ul> <li><strong>description</strong> modified (<a href="/trac10/ticket/11985?action=diff&amp;version=1">diff</a>) </li> </ul> Ticket