点击(此处)折叠或打开
-
template <typename T, typename Alloc>
-
inline void SimpleEraseVecotr(std::vector<T, Alloc> &vec, T val)
-
{
-
for(typename std::vector<T, Alloc>::iterator it=vec.begin();it!=vec.end();++it)
-
{
-
if(*it == val)
-
{
-
*it = vec.back();
-
vec.erase(vec.end()-1);
-
return;
-
}
-
}
- }