[cfe-dev] blocks and lambdas

James Gregurich bayoubengal at mac.com
Tue Feb 8 10:44:21 PST 2011


thanks for the info. I find it interesting.


On Feb 7, 2011, at 8:00 PM, John McCall wrote:

> On Feb 7, 2011, at 6:33 PM, James Gregurich wrote:
>> What if you build your lambda structure around the existing block structure such that the lambda type would have a copy constructor that calls Block_copy? If the lambda has a type, it stands to reason that it could have a copy constructor.
> 
> You seem to be describing a transformation which would occur when a block pointer is treated like a lambda.

no. not really a "transformation"...more of a syntactic wrapper.  you control your compiler and runtime. When clang hits a lambda in C++ code, I assume the backend could generate a block structure to implement the lambda. Also, if the lambda has a c++ type, then it could also have a copy constructor to invoke Block_copy so that the mechanism works normally with stl. Is such an assumption off-base?



>  That's not actually a knowable point in a program.

I don't understand what you mean by this statement.

-James




More information about the cfe-dev mailing list