Skip to content

Instantly share code, notes, and snippets.

@Cynede
Last active December 28, 2015 09:59
Show Gist options
  • Save Cynede/7483104 to your computer and use it in GitHub Desktop.
Save Cynede/7483104 to your computer and use it in GitHub Desktop.
([](int x) { printf("HELLO A %d\n", x + 4); })(1);
([](int x) { printf("HELLO B"); })(1);
([]() { printf("HELLO C %d\n"); })();
([](float a) { printf("HELLO D %d\n"); })(2.0);
/* output :
HELLO A 5
HELLO A 5
HELLO C 5
HELLO D 5
*/
@Cynede
Copy link
Author

Cynede commented Nov 15, 2013

note that above result is for clang, gcc at least with print "HELLO B"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment