Boost logo

Boost :

Subject: Re: [boost] AlRangeExandrescu?
From: Rogier van Dalen (rogiervd_at_[hidden])
Date: 2009-07-23 17:55:05

On Thu, Jul 23, 2009 at 13:48, David Abrahams<dave_at_[hidden]> wrote:
> Hi Neil,
> I'm sure someone already spoke to you about this, but just in case: Andrei
> Alexandrescu gave a very interesting presentation at BoostCon that was based
> on a "ranges only" approach that should eliminate issues like this one:

That looks very interesting. Is there any documentation on this out
there? I found the slides:

and documentation for a D implementation:

I'm wondering why "popFront()" is mutable and edits the range rather
than return a range without the first element. The latter might allow
compile-time heterogeneous sequences (like boost::fusion::vector) to
conform to this range concept as well. I just realised you could then
write a foreach function that works on both homogeneous and
heterogeneous sequences basically like:

template <class Range, class Function>
void foreach (Range range, Function function)
    if (!range.empty())
        function (range.front());
        foreach (range.popFront(), function);

Is popFront() mutable just for efficiency? Or is there something else
I'm missing?


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