Last active
September 10, 2017 15:33
-
-
Save demid5111/7cfcc02baf0feecc1b921dd0927d47bc 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
#include <iostream> | |
int main () { | |
// the most used form of lambdas without return type | |
auto basicLambdaFunc0 = [] () { std::cout << "Hello, lambda0" << std::endl;}; | |
// omitting parameters | |
auto basicLambdaFunc1 = [] { std::cout << "Hello, lambda1" << std::endl;}; | |
// the most detailed syntax | |
auto basicLambdaFunc2 = [] (void) -> void { std::cout << "Hello, lambda2" << std::endl;}; | |
basicLambdaFunc0(); | |
basicLambdaFunc1(); | |
basicLambdaFunc2(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment