bind1st & bind2nd
来源:互联网 发布:小旭音乐知乎 编辑:程序博客网 时间:2024/05/08 16:05
#include <iostream>#include <functional>#include <algorithm>#include <vector>using namespace std;int main(){vector<int> coll;for(int i = 1; i <= 13; ++i){coll.push_back(i);}//查找元素值大于10的元素的个数//也就是使得10 < elem成立的元素个数int res = count_if(coll.begin(), coll.end(), bind1st(less<int>(), 10));cout<<"[10 < elem]: "<<res<<endl;//查找元素值小于10的元素的个数//也就是使得elem < 10成立的元素个数res = count_if(coll.begin(), coll.end(), bind2nd(less<int>(), 10));cout<<"[elem < 10]: "<<res<<endl;return 0;}/*Output:[10 < elem]: 3[elem < 10]: 9*/
- bind1st & bind2nd
- bind1st bind2nd的使用
- 引用 bind1st bind2nd
- bind1st bind2nd的使用
- bind1st bind2nd的使用
- STL bind1st bind2nd详解
- STL bind1st bind2nd详解
- bind1st bind2nd的使用
- bind1st,bind2nd,not1,not2
- bind2nd 和 bind1st【转】
- bind1st bind2nd详解
- bind1st和bind2nd函数
- bind1st 和 bind2nd 解析
- bind1st和bind2nd
- 理解bind1st和bind2nd函数
- (转)bind1st、bind2nd的使用
- 二元函数与bind1st/bind2nd
- ptr_fun mem_fun_ref mem_fun bind1st bind2nd
- 2013清明假节将至新手租车要注意事项
- 第107章、android上传文件到服务器(从零开始学Android)
- java中分析""和null
- 将CString 型IP地址在IPAddressCtrl中显示
- 使用WEC7的NEON内在函数功能
- bind1st & bind2nd
- Eclipse快捷键大全(转载)
- hdu2023
- C++变量名放哪了
- 一个22岁程序员的辛酸之路
- 第五周项目五----学生累
- developer成长路线
- 依赖属性的相关概念
- 今天从my返回bj。