Apple Blocks added to C++?

Mattias Holm mattias.holm at openorbit.REMOVE.THIS.org
Wed Sep 2 06:59:24 PDT 2009


Walter Bright wrote:
> S. wrote:
> I find it strange that people are continuing to reinvent nested 
> functions in ugly ways.

The blocks are not nested functions, they are more like closures. There 
are some block copy functions that move a block to the heap (including 
the captured variables).

Nested functions can usually not be called after the defining function 
have returned. You cannot return blocks directly (since they are located 
on the stack), but you can return a heap copy of the block.



More information about the Digitalmars-d mailing list