64,266
社区成员
发帖
与我相关
我的任务
分享
class Student
{
int age;
string name;
public:
void print(int )
{
cout<<"I'm Student"<<endl;
}
string GetName()const
{
return name;
}
int GetAge() const
{
return age;
}
};
std::vector<Student>v;
v.reserve(10);
for(int i=0; i<10;i++)
v.push_backStudent());
std::for_each(v.begin(),v.end(),std::mem_fun_ref(&Student::print));
//用boost能解决 成员函数有参数的问题吗