7,539
社区成员




string name;
cin>> name;
return global_address_book.findMatchingAddresses(
// notice that the lambda function uses the the variable 'name'
[&] (const string& addr) { return addr.find( name ) != string::npos; }
);
ref: http://www.cprogramming.com/c++11/c++11-lambda-closures.html
class Test //这是一个类
{
public:
int Add(int i,int j){return i+j;}; //这是非静态函数
};
typedef int (Test::*pFunc )(int,int) ;
int main()
{
Test t; //对象
pFunc p = &Test::Add ;
int res= (t.*p)(1,2);//测试
//res结果为3
return 0;
}