KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I was pretty surprised when I found that the following code actually works: std::vector<int> list /*= ...*/; std::tr1::function<void(int)> func = ^(int i) { return i + 1; }; std::for_each(list.begin(), list.end(), func); Seems like std::tr1::function is capable of being constructed from an Objective-C block, but I'm not sure quite how, since (last I checked), its implementation doesn't specifically handle blocks. Is it somehow implicitly sucking out the underlying function pointer? Also, is this behavior undefined and likely to change?
Tags (comma-separated)
Save Edits
Cancel