Skip to content

Instantly share code, notes, and snippets.

@lshort
Created May 25, 2014 06:50
Show Gist options
  • Save lshort/9c05ba928e828b4ae973 to your computer and use it in GitHub Desktop.
Save lshort/9c05ba928e828b4ae973 to your computer and use it in GitHub Desktop.
auto incr = [](auto a) {return a+1;};
auto dbl = [](auto a) {return a*2;};
auto output_decorate = [](auto a) {cout<<a<<" "<<endl; return a;};
auto dbl_incr_decor = output_decorate * incr * dbl;
int x = dbl_incr_decor(5);
double y = dbl_incr_decor(.5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment