
2013/10/30 Akira Takahashi
2013/10/30 TONGARI J
Hi Akira,
I don't think this is what I want, but the underlying iterator may be similar to what I called 'counted_iterator', I'm not sure. So, 'span' is a utility function that generates a range from an iterator & size, unlike 'taken' which is an adaptor from another range. If you can provide the 'span' utility as well, that'll be great :)
Thanks,
fmm... What do you think about out of range check?
I'd say, it's the user's duty to ensure it won't go over the end.
What situation is it useful?
When you want to ignore the difference between RandomAccessIterator & ForwardIterator while keeping the efficiency of RandomAccessIterator. Some API may look like this: function(iterator, n, ...) that only require iterator to be ForwardIterator, but the implementation may sacrifice the efficiency of RandomAccessIterator, just because the implementor doesn't want to bother tag-dispatching for such optimization... (OK, I'm the one)