Boost logo

Boost :

Subject: Re: [boost] Is Boost.Range broken?
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-11-23 14:42:20


Scott McMurray skrev:
> On Sun, Nov 23, 2008 at 13:06, Daniel Walker <daniel.j.walker_at_[hidden]> wrote:
>> On Sun, Nov 23, 2008 at 1:49 AM, David Abrahams <dave_at_[hidden]> wrote:
>> <snip>
>>> Frankly, you don't even need to be that explicit: just write the
>>> semantics of empty as
>>>
>>> begin(r) == end(r)
>> That was the definition of the semantics of empty(r) before it was
>> (inexplicably) removed from the Range concept.
>>
>
> And despite not being mentioned in the concept
> (http://www.boost.org/doc/libs/1_37_0/libs/range/doc/range.html#single_pass_range
> and boost/range/concepts.hpp), it's still in the Semantics section of
> the "Synopsis and Reference" page
> (http://www.boost.org/doc/libs/1_37_0/libs/range/doc/boost_range.html#Semantics).
>
> In fact, why does iterator_range have a public empty() method at all?
> It's modelling a range, so boost::empty will use boost::begin and
> boost::end, completely ignoring iterator_range<T>::empty. Making
> ir.empty() just sugar for boost::empty(ir) seems the only reasonable
> way to avoid consistency problems. (Removing the member altogether
> would be nice, but it's probably too late for that.)

We are going way to much in detail here. All these matters where settled
at the initial design and review. I belive it was for convinience.

I suggest that we direct our time at other topics.

-Thorsten


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