[cfe-dev] Blocks vs. C++ lambda's?

Remy Demarest psycho.hedgehog at me.com
Thu Apr 30 17:48:34 PDT 2009


Well, yes and no...

For starter, Apple's syntax doesn't need you to say anything about  
capturing variables, they're just captured. The [=]{} seems to be  
equivalent with normal variables, their value is copied inside the  
block's structure and it's constant.

But I was talking about __block variables. You add "__block" in front  
of a variable declaration and then you're allowed to modify its value  
inside the block, and that change is mirrored in every blocks in the  
same scope that capture that variable, too.

Remy Demarest



More information about the cfe-dev mailing list