$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [boost] Is Boost.Range broken?
From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2008-11-23 14:19:50
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.)