Subject: [Boost-bugs] [Boost C++ Libraries] #12087: transform_iterator is not assignable in VS2015
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-03-22 13:55:07
#12087: transform_iterator is not assignable in VS2015
------------------------------+------------------------------
Reporter: bswerts@⦠| Owner: jeffrey.hellrung
Type: Bugs | Status: new
Milestone: To Be Determined | Component: iterator
Version: Boost 1.60.0 | Severity: Problem
Keywords: |
------------------------------+------------------------------
The following code does not compile in Visual Studio 2015 because the
assignment operator of transform_iterator seems to be deleted:
#include "boost/iterator/transform_iterator.hpp"
#include <vector>
int main()
{
auto v = std::vector<int>{};
auto it = boost::make_transform_iterator(std::begin(v), [](int) {
return 1; });
it = it;
return 0;
}
The line 'it = it' is the culprit, giving
error C2280:
'boost::iterators::transform_iterator<main::<lambda_245a5d22fdccfa4a35ac6bb4a4dc8307>,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<int>>>,boost::iterators::use_default,boost::iterators::use_default>
&boost::iterators::transform_iterator<main::<lambda_245a5d22fdccfa4a35ac6bb4a4dc8307>,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<int>>>,boost::iterators::use_default,boost::iterators::use_default>::operator
=(const
boost::iterators::transform_iterator<main::<lambda_245a5d22fdccfa4a35ac6bb4a4dc8307>,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<int>>>,boost::iterators::use_default,boost::iterators::use_default>
&)': attempting to reference a deleted function
boost\iterator\transform_iterator.hpp(127): note: compiler has generated
'boost::iterators::transform_iterator<main::<lambda_245a5d22fdccfa4a35ac6bb4a4dc8307>,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<int>>>,boost::iterators::use_default,boost::iterators::use_default>::operator
=' here
I assume iterators need to be assignable. Furthermore I see no reason why
the compiler wouldn't generate the standard member functions. Everything
compiles OK in VS2013.
Thanks in advance for having a look.
Regards,
Ben
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12087> 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