vector

查找

vector::iterator findit = find(v1_.begin(),v1_.end(),point);
if(findit!=v1_.end())
{
}

erase

std::vector vec;
vec.push_back(6);
vec.push_back(-17);
vec.push_back(12);
vec.erase(vec.begin() + 1);
 或
vec.erase(vec.begin() + 1, vec.begin() + 3);

发表评论