This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Blocks in g++ ?
Per Bothner <bothner@pacbell.net> writes:
> It is worth pointing out that blocks, if implemented as lexical
> closures as is the de facto Smalltalk standard, are much more
> powerful than Gcc's nested functions, since the latter do *not*
> create proper closures. (Creating closures is probably not
> practical unless you have garbage collection.)
And anyway, g++ doesn't have nested functions, as far as I can see.
How about function objects (like those in what used to be called STL)?
They provide something a bit like blocks, although not quite the same.