Created
January 6, 2016 03:03
-
-
Save kinoshita-lab/50f80af5f61e5636166d 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
template< typename F > | |
void tenTimes(F f) | |
{ | |
for (auto i = 0; i < 10; ++i) { | |
f(); | |
} | |
} | |
int main() | |
{ | |
tenTimes([](){ | |
puts("Hello World"); | |
}); | |
#define lambda [] // !!! | |
tenTimes(lambda(){ | |
printf("%d\n", rand()); | |
}); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment