bind1st 和 bind2nd的区别
来源:互联网 发布:vr源码 编辑:程序博客网 时间:2024/05/17 22:23
今天总算是弄明白bind1st和bind2nd是怎么用的,有什么区别了。只知道工作,不知道学习很久了。
// bind1st example
#include <iostream>
#include <functional>
#include <algorithm>
using namespace std;
int main () {
int numbers[] = {10,20,30,40,50,10};
int cx;
cx = count_if (numbers, numbers+6, bind1st(greater<int>(),10) );
cout << "There are " << cx << " elements that are equal to 10.\n";
return 0;
}
// bind2nd example
#include <iostream>
#include <functional>
#include <algorithm>
using namespace std;
int main () {
int numbers[] = {10,20,30,40,50,10};
int cx;
cx = count_if (numbers, numbers+6, bind2nd(greater<int>(),10) );
cout << "There are " << cx << " elements that are equal to 10.\n";
return 0;
}
Reference:
http://stackoverflow.com/questions/6112573/bind1st-and-bind2nd
http://stackoverflow.com/questions/6863677/use-bind1st-or-bind2nd
http://www.cplusplus.com/reference/functional/bind1st/
http://www.cplusplus.com/reference/functional/bind2nd/
- bind1st 和 bind2nd的区别
- STL中bind1st和bind2nd的区别
- std::bind1st与std::bind2nd的区别
- 函数bind1st 和 bind2nd 的说明
- 解析bind1st和bind2nd的使用
- 解析bind1st和bind2nd的使用
- (转)解析bind1st和bind2nd的使用
- 解析bind1st和bind2nd的使用
- (转)解析bind1st和bind2nd的使用
- bind2nd 和 bind1st【转】
- bind1st和bind2nd函数
- bind1st 和 bind2nd 解析
- bind1st和bind2nd
- bind1st bind2nd的使用
- bind1st bind2nd的使用
- bind1st bind2nd的使用
- bind1st bind2nd的使用
- 理解bind1st和bind2nd函数
- 六大设计原则之三_依赖倒置原则(DIP)
- 我的第一个GNURadio应用程序…
- python 参数传递及分类
- How GNURadio Core Works
- js判断输入是否中文,数字,身份证等等js函数
- bind1st 和 bind2nd的区别
- java面向对象
- 如何开关linux默认的防火墙
- ++ STL的各种实现版本介绍
- 计算机互联设备
- Android测试驱动开发实践2
- phpexcel 导出数据库中数据到excel表中
- lua和tolua++的安装
- 查看linux中shell的几种方法汇总