Created
December 22, 2013 16:16
-
-
Save vinhnx/8084784 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creating a lambda in C++ with variable type inferred automatically | |
auto someLambda = [](float w, int x, int y) { return(x); }; | |
// Creating a block in C/ObjC without the use of a typedef -- UGLY | |
int (^someBlock)(float, int, int) = ^(float w, int x, int y) { return(x); }; | |
// Creating a block in CPP/ObjCPP with variable type inferred automatically -- NOT TOO BAD | |
auto someBlock = ^(float w, int x, int y) { return(x); }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment