30 Oct
2013
30 Oct
'13
8:18 a.m.
2013/10/30 Evgeny Panasyuk
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?
For RandomAccessIterators, 'span' will return the iterator as is, no wrapping.
2. Imagine if we have std::list x with 10 elements. Will dereference of end(span(begin(x), 5)) be undefined?
It's defined to be non-dereferenceable.