Boost logo

Boost :

Subject: Re: [boost] AlRangeExandrescu?
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-07-25 14:13:39


Andrei Alexandrescu skrev:
> Thorsten Ottosen wrote:
>> Andrei Alexandrescu skrev:
>>
>>>>> Surprisingly, until() also works on input ranges! It works because
>>>>> it finds the element lazily - it returns a range that tests for
>>>>> termination condition in its .empty() test. So until() returns a
>>>>> range that iterates the original passed-in range until the sought
>>>>> element is found, at which time until() reports termination.
>>>>
>>
>> Is until lazy for all types of ranges? Being lazy is often good, but
>> it's so nice to compose a lazy range with other types of ranges.

A "not" slipped here.

> Yes, until is lazy. I think it couldn't be implemented any other way for
> input ranges.

Ok, but the problem with lazy ranges is that when you compose it with
range adaptors, then it greatly limits the adaptors that you can
subsequently apply.

-Thorsten


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