STL示例09(绑定器bind1st)
来源:互联网 发布:淘宝号码 编辑:程序博客网 时间:2024/06/05 22:54
//STL示例 绑定器函数对象bind1st#include <iostream>#include <algorithm>#include <functional>#include <list>using namespace std;int iarray[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};list<int> aList(iarray, iarray + 10);int main(){int k = 0;//count_if统计满足条件的元素个数/*其中greater()实现如下template<class T> struct greater : public binary_function<T, T, bool> { bool operator()(const T& x, const T& y) const {return (x>y);}; };bind1st函数作用是将8绑定到greater的第一个参数上,看上面greater类型定义及实现可以知道这里是求小于8的元素*/k=count_if(aList.begin(), aList.end(),bind1st(greater<int>(),8));cout << "小于8的数的个数 :" << k << endl;return 0;}
- STL示例09(绑定器bind1st)
- STL的bind1st,bind2nd,mem_fun,mem_fun_ref使用示例
- STL之bind1st
- STL bind1st bind2nd详解
- STL bind1st bind2nd详解
- stl 中bind1st和bind2nd
- STL::bind1st STL::bind2st boost::bind
- STL中bind1st和bind2nd的区别
- stl之bind1st,bind2nd解读(转)
- 【STL】bind1st与bind2nd函数解析
- STL binder1st binder2nd bind1st bind2nd区别
- STL bind1st、bind2nd的使用【转】
- STL中bind1st和bind2nd之解析
- STL: bind1st, bind2nd 的使用(C++)
- 【STL】bind1st与bind2nd函数解析
- 【STL】函数 for_each; bind1st和bind2nd,not1; mem_fun和mem_fun_ref;
- STL中绑定器的使用
- STL迭代器值迭代器绑定器:Insert Iterators
- 查询系统负载信息 Linux uptime命令详解
- Unix/Linux下的/etc目录
- IOS 用户警告菜单实例
- iPhone程序开发 图形和动画入门指南
- 北京之初体验
- STL示例09(绑定器bind1st)
- TMS320VC5509A的存储器、系统启动与中断、时钟(PLL)
- IOS 用户警告表单实例
- Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并
- STL删除元素时会清理哪些东西?
- 07-事事精明,人人远离。
- 这样学英语三个月超过你过去学三年
- 基于Web开放平台的应用的开发的一些研究
- tomcat的加速器--Apache Tomcat Native