Created
March 20, 2018 19:52
-
-
Save bayoubengal/e4877efd84b32fb48b4fb00fb1e4a5c9 to your computer and use it in GitHub Desktop.
This file contains 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
//suggestion: add @lambda() operator to objc++ mode that generates implicitly the | |
//following lambdas | |
//auto tmpCalcuStringLmbda = @lambda( -[cMyClass calculateStringValue:withNumber:] ); | |
auto tmpCalcuStringLmbda = [](cMyClass* theObjPtr, NSString* theValue1Ptr, size_t theValue) | |
{ | |
return [theObjPtr calculateStringValue: theValue1Ptr withNumber: theValue]; | |
}; | |
//auto tmpDefaultStringLambda = @lambda( +[cMyClass defaultStringValue] ); | |
auto tmpDefaultStringLambda = []( /*args here. example features no args*/ ) | |
{ | |
return [cMyClass defaultStringValue /*args here*/ ]; | |
}; | |
auto tmpCalcString3 = tmpCalcuStringLmbda(tmpMyClassPtr, @"test3", 16 ); | |
auto tmpDefaultString4 = tmpDefaultStringLambda( /* no args in this example*/ ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment