Boost logo

Boost :

Subject: Re: [boost] Is Boost.Range broken?
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-11-25 10:38:39


Andrew Sutton skrev:
>> My point was that a default constructed range may be in a perfectly valid
>>> state, too, depending on its iterators.
>>>
>>>
>> Indeed. I think that a default constructed iterator_range should be usable
>> and empty
>> iff default constructed iterators are non-singular and equal. This
>> effectively
>> pushes dealing with default construction onto the iterators. IMO, this is
>> more consistent than the old behavior, where a default constructed
>> iterator_range was "empty", but r.begin() == r.end() could be undefined
>> behavior.
>>
>
> I think this is the right answer (and pretty well argued by now). The
> behavior of the iterator_range should "inherit" (is there a better word for
> this?) its semantics from the underlying iterator. To do otherwise would
> impose requirements on iterators that may not (easily) support those
> semantics, making the concept less generic (as in represents fewer possible
> implementations).

Well, it is fairly easy to remove some of the debug-checks from the
code. Do I understand you correctly in that you want them all removed?

-Thorsten


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