
19 Oct
2011
19 Oct
'11
8:46 a.m.
On Wed, Oct 19, 2011 at 1:45 AM, Rhys Ulerich <rhys.ulerich@gmail.com> wrote:
iterator_range returns a signed size. Is this correct? IMO it should return size_t.
boost\range\iterator_range_core.hpp: difference_type size() const { return m_End - m_Begin; }
Random thought: It seems like advance_begin and advance_end could be used to create a strictly negative size. Returning difference_type allows this to be detected while a size_type does not.
Sounds like a very weak reason. Especially since: If an instance of iterator_range is constructed by a client with two iterators, the client must ensure that the two iterators delimit a valid closed-open range [begin,end). If that's the rationale, it'd be better to add is_valid() or so. Olaf