Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-04-21 07:20:37


"Daniel Wallin" <dalwan01_at_[hidden]> wrote in message
news:c65o14$n90$1_at_sea.gmane.org...
| 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.

but you cannot call break such a loop. With for each + auto we could say

for( auto i : cont )
    *i += 2;

br

Thorsten


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