Boost logo

Boost :

Subject: Re: [boost] [range] RFC: span(iterator, size)
From: Evgeny Panasyuk (evgeny.panasyuk_at_[hidden])
Date: 2013-10-30 03:43:21


30.10.2013 11:29, TONGARI J:
>> 1. So, span(first, n) and span(next(first), n) will result in "equal"
>> iterators?
> if you mean begin-or-end(span(first, n)) == begin-or-end(span(next(first),
> n)), then yes, but it's pathic.

Yes, that what I mean. This limitation should be placed as warning.

>>> Especially you mentioned that you plan to preserve same range category as
>>> original iterator has - what about BidirectionalIterators?
>> That's my mistake, they should be ForwardIterators.

1. What about RandomAccessIterators?
2. Imagine if we have std::list x with 10 elements. Will dereference of
end(span(begin(x), 5)) be undefined?

-- 
Evgeny Panasyuk

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk