1、删除:
vector<InfoDetect>::iterator it;
for (it = VeDetectInfo.begin();it!=VeDetectInfo.end();)
{
if (GetTickCount()-it->dwTime>5*60*1000)
{
it=VeDetectInfo.erase(it);
}
else
{
。。。。
it++;
}
}
2排序:
bool BodyCompare(const InfoDetect& obj1,const InfoDetect& obj2)
{
return obj1.nBody>obj2.nBody;
}
bool FaceCompare(const InfoDetect& obj1,const InfoDetect& obj2)
{
return obj1.nFace>obj2.nFace;
}
sort(VeDetectInfo.begin(), VeDetectInfo.end(),BodyCompare) ;
sort(VeDetectInfo.begin(), VeDetectInfo.end(),FaceCompare) ;