Skip to content

Instantly share code, notes, and snippets.

@picanumber
Created November 23, 2016 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save picanumber/adb3e6345d3a2b54cc5b70180de1e6dd to your computer and use it in GitHub Desktop.
Save picanumber/adb3e6345d3a2b54cc5b70180de1e6dd to your computer and use it in GitHub Desktop.
int main()
{
auto f1 = [](auto a) { return 2 * a; };
auto f2 = [](auto a) { return 3 * a; };
auto f3 = [](auto a, auto b) { return b * a; };
auto cfs = compose(f1, f2, f3);
std::cout << cfs(2, 3) << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment