
c++STL中的仿函数
文章平均质量分 89
ljl_xiao_wa
这个作者很懒,什么都没留下…
展开
-
仿函数的使用
//利用仿函数写一个通用的数组求和算法,只要修改仿函数还可以轻松的实现其他的功能 #include #include using namespace std; template inline T accumulate(InputIterator first, InputIterator last, T init, FunObject object) {//函数对象原创 2016-05-25 22:05:53 · 831 阅读 · 0 评论 -
函数配接器
组合函数配接器的可能表现形式 功能 名称 SGI STL的名称 f(g(elem)) compose_f_gx compose1 f(g(elem,elem2)) compose_f_gxy f(g(elem),h(elem)) compose_f_gx_hx compose2 f(g(elem),h(elem2)) comp原创 2016-05-28 21:29:13 · 277 阅读 · 0 评论