我是 C++ 新手,正在尝试使用该copy_if函数:
set<Person> people; // contains people objects
set<Person> copyedPeople;
string name = "joe"; // Multiple people with that name
copy_if(people.begin(), people.end(), copyedPeople, Person.getName() == name);
Run Code Online (Sandbox Code Playgroud)
问题出在Person.getName(),它说类型名称不允许?