This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]