Boost logo

Boost :

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

30.10.2013 5:38, TONGARI J:

>> That reminds me CountedRanges from STL:**
>> v=dUEA8fHx0r0&t=35m14s<>
> Thanks for the link,I'll take a look later.

(note, it is link to exact moment which lasts several minutes, not the
whole video)

>> What type of underlying iterator you plan to use, let say for
>> ForwardIterator?
> So called 'counted_iterator', same category as the wrapped one.
> It looks like this type will contain not just iterator, and *efficient*
>> implementation is not clear for me.
> The states are:
> iterator it;
> std::size_t count;
> For comparison, only count is compared;
> dereference is simply *it;
> increment both it & count;

1. So, span(first, n) and span(next(first), n) will result in "equal"

2. As I understand, span(first, n) will produce following "iterators":
begin {.it = first, .count = 0}
end { .it = ???, .count = n }
What is Especially you mentioned that you plan to preserve same
range category as original iterator has - what about BidirectionalIterators?

Evgeny Panasyuk

Boost list run by bdawes at, gregod at, cpdaniel at, john at