feat(util/buffer): add method erase_elem
This commit is contained in:
parent
57490a6431
commit
9be67bc0b1
1 changed files with 9 additions and 0 deletions
|
@ -153,6 +153,15 @@ public:
|
||||||
m_pos--;
|
m_pos--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void erase_elem(T const & elem) {
|
||||||
|
for (unsigned i = 0; i < size(); i++) {
|
||||||
|
if (m_buffer[i] == elem) {
|
||||||
|
erase(i);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void insert(unsigned idx, T const & elem) {
|
void insert(unsigned idx, T const & elem) {
|
||||||
using std::swap;
|
using std::swap;
|
||||||
lean_assert(idx <= size());
|
lean_assert(idx <= size());
|
||||||
|
|
Loading…
Reference in a new issue