void BloodDonationPoint::sortBlood()
{
std::sort(bloodBank.begin(), bloodBank.end(), isOlder);
}
bool BloodDonationPoint::isOlder(BloodUnit* a, BloodUnit* b)
{
return a->getTimeToGoingBad()<b->getTimeToGoingBad();
}
error C3867: 'BloodDonationPoint::isOlder': non-standard syntax; use '&' to
create a pointer to member
error C2672: 'sort': no matching overloaded function found
error C2780: 'void std::sort(const _RanIt,const _RanIt)': expects 2 arguments - 3 provided
为什么它会起作用? Bloodbank只是指向BloodUnits的指针。