?? vector_remove.h
字號:
#ifndef _VECTOR_REMOVE_H
#define _VECTOR_REMOVE_H
#include "vector"
template<class T>
bool remove(std::vector<T>& lst, const T& t)
{
for( int i=0; i<lst.size(); i++ )
{
if( t == lst[i] )
{
lst.erase(lst.begin()+i);
return true;
}
}
return false; // not found
}
#endif // _VECTOR_REMOVE_H
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -