Boost logo

Boost :

From: Daniel Wallin (dalwan01_at_[hidden])
Date: 2004-04-21 07:09:11


John Torjo wrote:

> michael toksvig wrote:
>> But there is no denying the notational clarity and succinctness of e.g.:
>> foreach(double &d, container)
>> d += 2;
>>
>>
>>
> You can also use the rtl (Ranges Template Library):
> (note: I'll rename the library, wince there's another one with the same
> name ;))
>
> for( crange<container> r(cont); r; ++r)
> *r += 2;

   xxx::for_each(cont, _1 += 2);

IMO C++ isn't missing a loop construct, it's missing a lambda construct.

-- 
Daniel Wallin

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