
21 Apr
2004
21 Apr
'04
3:12 p.m.
Daniel Wallin wrote:
xxx::for_each(cont, _1 += 2);
IMO C++ isn't missing a loop construct, it's missing a lambda construct.
IMO, C++ is missing a foreach construct *and* a lambda construct. :-) When the loop body is non-trivial, writing it as a lambda would make the code hard to follow. I shudder at the thought of a lambda that takes up more than a few lines. A foreach construct would make it easier to read, in that case. -- Eric Niebler Boost Consulting www.boost-consulting.com