Boost logo

Boost Users :

Subject: Re: [Boost-users] cannot convert from 'const boost::iterator_range<IteratorT>' to 'const std::basic_string<_Elem, _Traits, _Ax>'
From: Jeff Flinn (Jeffrey.Flinn_at_[hidden])
Date: 2012-04-04 08:10:32


On 4/4/2012 6:40 AM, Igor R wrote:
>> std::string s = *i; ////////////////////////////COMPILER ERROR:
>> cannot convert from 'const boost::iterator_range<IteratorT>' to 'const
>> std::basic_string<_Elem,_Traits,_Ax>'
>> std::cout<< s<< '\n';
>
>
> std::string s(i->begin(), i->end());

or use copy_range<std::string>(*i) which is defined in
<boost/range/iterator_range.hpp>

Jeff


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net