Boost logo

Boost Users :

From: Thorsten Ottosen (tottosen_at_[hidden])
Date: 2005-12-09 16:42:35


MB wrote:
> Thorsten Ottosen wrote:
>
>>Victor A. Wagner Jr. wrote:
>>
>> >> Seems to me that sub_range is a convenience class to describe
>>iterator ranges from ranges or containers that model ForwardRange, from
>>which you can propagate constness.
>> >
>> >
>> >
>> > yup, that's what I thought also
>>
>>
>>It seems that the problem was caused by the fact that the vc71
>>generates default operators a bit wierd.
>> The copy-constructor is default generated and so does simply copy the
>>iterators. It seems that the default generated constructor/ assignment
>>for sub_range calls a templated version of iterator_range's
>>construcgtor/ assignment operator
>>
>>I think this might be a bug in the compiler.
>
>
> I thought it was intentional.
> See:
>
> void test()
> {
> std::string str;
>
> // hey, const sub_range.
> const boost::sub_range<std::string> rng1(str);
>
> // whether or not to allow...?
> boost::sub_range<std::string> rng2 = rng1;
> }
>
> I don't know the answer for sure.

Can you assing a const vector<T> to a mutable vector<T>?

-Thorsten


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