This commit is contained in:
aozhiwei 2020-10-13 15:20:58 +08:00
parent 3a005b95f4
commit 6a750f136e

View File

@ -64,6 +64,20 @@ namespace a8
return set_.find(val) != set_.end();
}
void Remove(T* val)
{
if (!Exists(val)) {
return;
}
{
auto itr = std::find(list_.begin(), list_.end(), val);
if (itr != list_.end()) {
list_.erase(itr);
}
}
set_.erase(val);
}
};
template <typename T>