Opened 7 years ago

Last modified 7 years ago

#11985 new Bugs

range: compiler-error sub_range copy-constructor workaround for MSVC — at Initial Version

Reported by: Tobias Loew Owned by: Neil Groves
Milestone: To Be Determined Component: range
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

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

Change History (0)

Note: See TracTickets for help on using tickets.