Skip to content

Instantly share code, notes, and snippets.

@kinoshita-lab
Created January 6, 2016 03:03
Show Gist options
  • Save kinoshita-lab/50f80af5f61e5636166d to your computer and use it in GitHub Desktop.
Save kinoshita-lab/50f80af5f61e5636166d to your computer and use it in GitHub Desktop.
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