2cl (pronounce "toccle") is a functional programming extension for C++
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

26 行
354 B

#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;