bind使用
来源:互联网 发布:香港网络的英文缩写 编辑:程序博客网 时间:2024/06/04 19:46
int add(int a, int b)
{
return a + b;
}
int sub(int a, int b)
{
return a - b;
}
template<typename T,typename V>
auto Test(const T&& t, const V& v1, const V& v2)->decltype(v1+v2)
{
auto vv = bind(t, v1, v2);
return vv();
}
int _tmain(int argc, _TCHAR* argv[])
{
int v = Test(add, 10, 20);
CTest t;
t.show();
system("pause");
return 0;
{
return a + b;
}
int sub(int a, int b)
{
return a - b;
}
template<typename T,typename V>
auto Test(const T&& t, const V& v1, const V& v2)->decltype(v1+v2)
{
auto vv = bind(t, v1, v2);
return vv();
}
int _tmain(int argc, _TCHAR* argv[])
{
int v = Test(add, 10, 20);
CTest t;
t.show();
system("pause");
return 0;
}
#include <functional>
using namespace std::placeholders;
class CTest
{
public:
CTest();
~CTest();
int test(int a, int b)
{
return a + b;
}
void show()
{
callT = std::bind(&CTest::test, this, _1, _2);
int va = callT(10, 20);
}
private:
using CallFun = std::function<int(int, int)>;
CallFun callT;
};
0 0
- bind使用
- BOOST::bind 如何使用
- bind使用小结
- bind的chroot使用
- boost::bind的使用
- boost bind的使用
- boost bind使用资料
- boost bind的使用
- Boost.bind 的使用
- bind/function使用
- boost::bind的使用
- 使用boost的bind
- Boost::bind使用详解
- std::bind的使用
- Bind 函数的使用
- std::bind()的使用
- dojo.io.bind使用详解
- boost的bind使用感受
- 第七次作业
- 关于触发器一些小结
- OpenGL在MFC对话框上进行立方体贴图
- hadoop图片处理毕业设计
- 欢迎使用CSDN-markdown编辑器
- bind使用
- 在控制台中显示Hibernate打印的SQL中的参数
- 第六周上机项目3 人数不定的工资类
- “SpringBoard 无法启动应用程序 错误-3″的解决办法
- DPDK中Log的使用方法
- 设计与开发应用服务器(二)------相关技术
- ospf总结
- PHP与Apache整合教程
- 010-Struts框架拦截器三