[Boost-bugs] [Boost C++ Libraries] #11985: range: compiler-error sub_range copy-constructor workaround for MSVC

Subject: [Boost-bugs] [Boost C++ Libraries] #11985: range: compiler-error sub_range copy-constructor workaround for MSVC
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-02-15 09:32:02


#11985: range: compiler-error sub_range copy-constructor workaround for MSVC
------------------------------+------------------------
 Reporter: tobias.loew | Owner: neilgroves
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: range
  Version: Boost 1.61.0 | Severity: Problem
 Keywords: |
------------------------------+------------------------
 Hi,

 the following code generates an error when compiled with MSVC 11 (aka VS
 2012)

     std::vector<int> arr;
     arr.push_back(42);
     boost::sub_range<std::vector<int>> ran = arr;
     boost::sub_range<std::vector<int>> ran_2 = ran;
     const boost::sub_range<std::vector<int>>& ran_ref = ran;
     boost::sub_range<std::vector<int>> ran_3 = ran_ref;


 Error: libs\boost\boost\boost\range\iterator_range_core.hpp(69): error
 C2440: 'static_cast' : cannot convert from
 'std::_Vector_const_iterator<_Myvec>' to 'std::_Vector_iterator<_Myvec>'


 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.

 Tobias

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11985>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC