Skip to content

Instantly share code, notes, and snippets.

@demid5111
Last active September 10, 2017 15:33
Show Gist options
  • Save demid5111/7cfcc02baf0feecc1b921dd0927d47bc to your computer and use it in GitHub Desktop.
Save demid5111/7cfcc02baf0feecc1b921dd0927d47bc to your computer and use it in GitHub Desktop.
#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