64,646
社区成员
发帖
与我相关
我的任务
分享
#include <boost/bind.hpp>
#include <iostream>
using namespace std;
class TEST{
public:
void Print(int ival)
{
cout<<"执行打印: "<<ival<<endl;
}
};
int main(int argc, char **argv)
{
TEST test;
boost::bind(&TEST::Print, test, _1)(1);
int tt = 0;
tt =1;
}
#include <boost/bind.hpp>
#include <iostream>
using namespace std;
class TEST{
public:
void Print(int ival, int iVal2)
{
cout<<"执行打印: " << ival << "," << iVal2 <<endl;
}
};
template <typename Printer>
void print42(Printer& printer)
{
printer(42);
}
int main(int argc, char **argv)
{
TEST test;
auto printer = boost::bind(&TEST::Print, test, _1)(1);
print42(printer);
}