Boost logo

Boost :

From: Max Motovilov (max_at_[hidden])
Date: 2004-03-03 17:00:11


"Powell, Gary" <powellg_at_[hidden]> wrote in message
news:16D81990DBE42642A8CA977A55FF116A0BD397_at_ex-mail-sea-02.ant.amazon.com...

> // PROPOSED CHANGE IN SOME FUTURE PAPER
>
> unsigned long n = std::accumulate(
> xs.begin(), xs.end(), 0UL,
> long (long lhs, X const &rhs) // inline fn with no name.
> {
> return lhs + rhs.count;
> }
> );

Yeah, but do you propose to make local names visible inside the anonymous
function, or not? If you do, you open a big can of worms for implementations
(recursive nested functions, need I say more?), if you don't, BLL can still
do things that anonymous functions can not. Anonymous functors could help
some, but their syntax won't be quite as compact as your example above.

...Max...


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