Skip to content

Instantly share code, notes, and snippets.

@Y-Less
Created November 13, 2019 11:26
Show Gist options
  • Save Y-Less/97075fd7c7c418f13d6f2341cfdc3325 to your computer and use it in GitHub Desktop.
Save Y-Less/97075fd7c7c418f13d6f2341cfdc3325 to your computer and use it in GitHub Desktop.
#include "curry.hpp"
#include <iostream>
int AddThree(int a, int b, int c)
{
return a + b + c;
}
int main()
{
auto C = Curry(AddThree);
std::cout << C(0)(1)(2) << std::endl;
std::cout << C(0)(1, 2) << std::endl;
std::cout << C(0, 1, 2) << std::endl;
std::cout << C(5)(1)(2) << std::endl;
std::cout << C(6)(1, 2) << std::endl;
std::cout << C(7, 1, 2) << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment