c++函数式编程
Silent_Blue_Sky
欢迎留言讨论
展开
-
c++ 高阶函数 numeric库
【代码】c++ 高阶函数 numeric库。原创 2022-11-15 17:51:01 · 346 阅读 · 0 评论 -
c++函数式编程2-函数式对象的生成
紧接上文,我们发现一个问题, 我们只能使用函数式对象, 而不能用已经存在的函数,下面讲讲如何解决这个问题int add(int i) { return i + 1;}auto print_one = [](int data) { cout << data << endl; return data;};// 函数包装类生成器#define define_functor_type(func_name) \class func_name##_wra原创 2021-05-28 11:57:58 · 74 阅读 · 0 评论 -
c++ 函数式编程-管道流水线
#include <iostream>#include <utility>#include <vector>#include <algorithm>using namespace std;// 重载 operator// 注意operator| 重载时两个参数至少一个必须为类类型或者class枚举类型template<typename T, class F>auto operator|(T &¶m, F.原创 2021-05-25 19:30:59 · 615 阅读 · 1 评论