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.
|
#include "2CL.hpp"
|
|
#include <assert.h>
|
|
|
|
struct test_003{
|
|
test_003()
|
|
{
|
|
auto fn = cl::curry(
|
|
[](int a,int b)->int{return a+b;},
|
|
11
|
|
);
|
|
assert(fn(1)()==12);
|
|
}
|
|
};
|
|
|
|
test_003 run_003;
|
|
|
|
struct test_004{
|
|
test_004()
|
|
{
|
|
using namespace cl;
|
|
auto fn = function([](int a, int b)->int{return a+b;});
|
|
assert(fn(2)(7)()==9);
|
|
}
|
|
};
|
|
|
|
test_004 run_004;
|