removes the first element in the vector "is equal to a value".
std::vector<Elem> coll; ... //remove first element with value val std::vector<Elem>::iterator pos; pos = find(coll.begin(),coll.end(),val); if(pos != coll.end()) { coll.erase(pos); }
removes the first element in the vector "is equal to a value".
std::vector<Elem> coll; ... //remove first element with value val std::vector<Elem>::iterator pos; pos = find(coll.begin(),coll.end(),val); if(pos != coll.end()) { coll.erase(pos); }