2cl (pronounce "toccle") is a functional programming extension for C++
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 regels
354 B

  1. #include "2CL.hpp"
  2. #include <assert.h>
  3. struct test_003{
  4. test_003()
  5. {
  6. auto fn = cl::curry(
  7. [](int a,int b)->int{return a+b;},
  8. 11
  9. );
  10. assert(fn(1)()==12);
  11. }
  12. };
  13. test_003 run_003;
  14. struct test_004{
  15. test_004()
  16. {
  17. using namespace cl;
  18. auto fn = function([](int a, int b)->int{return a+b;});
  19. assert(fn(2)(7)()==9);
  20. }
  21. };
  22. test_004 run_004;