64,654
社区成员
发帖
与我相关
我的任务
分享
class CStudent
{
public:
void operator() (string strName, int nAge)
{
cout << strName << " : " << nAge << endl;
}
};
int main()
{
using namespace std::placeholders;
//----------#1
auto one = bind(CStudent(), "mi", _1);
one(12);
//--------#2
CStudent student;
auto two = bind(&CStudent::operator(), student, "mi", _1);
two(12);
return 0;
}