
On 22/07/2011 16:31, Samuel Debionne wrote:
for instance sub_range have :
iterator begin() { return base::begin(); } *const_iterator* begin() const { return base::begin(); }
and boost::begin() is :
inline range_iterator<T>::type begin( T& r ) {...} inline range_iterator<*const* T>::type begin( const T& r ) {...}
which means that I'm probably wrong. Am I missing something ?
That explains the strange problems I had when I tried using sub_range. iterator_range does not have those problems. But it seems to be a feature, it you look at the doc of sub_range it says, when comparing sub_range to iterator_range, "Moreover, the sub_range class can propagate constness since it knows what a corresponding const_iterator is." This is, in my opinion, a mistake. const sub_range<T> should *not* behave like sub_range<const T>.