struct findCategoryByName
{
string name;
bool operator()(const category& a)
{
return (a.name == name);
}
};
struct findEntryByName
{
string name;
bool operator()(const entry* a)
{
return (a->name == name);
}
};
有没有办法使用模板元编程或其他东西来做到这一点?如果有帮助,我总是可以使用指针将其设为类别*。