Boost logo

Boost :

From: Powell, Gary (powellg_at_[hidden])
Date: 2006-04-13 11:44:21


> [mailto:boost-bounces_at_[hidden]] On Behalf Of Peter Dimov
> I was looking at the lambda papers recently and I came to the
> conclusion that what we actually need is local functions. To
> pick an example from
> N1958:
>
I would like local functions in addition to lambda's as well. There is a very old paper that proposed it.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1993/
X3J16/93-0088 WG21/N0295 [PS] [PDF]
A proposal for Nested Functions
John Max Skaller & Fergus Henderson

It's a slightly different need though than the current C++ lambdas. The main difference is that with the current library lambda implementations you by default get access to all of the surrounding function's local variables mentioned in the lambda statement. With a nested function you have to bring them in via arguments etc.

It's still a nice feature and you should check out this paper.

  -Gary-


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