title: What alternative to C++ vector when it comes to fast deletion?
body: <p>vector is the first choice in many situations because random access is O(1), as there are not many containers that are fast enough, or at least O(log(n)).</p>
  
  <p>My issue with vector being that <code>vector&lt;&gt;::erase()</code> is O(n), <code>map&lt;&gt;::erase()</code> is faster and is a better container.</p>
  
  <p>An alternative would be to use an object pool, but it is not a standard container, and implementations might vary depending on use, so I'm not very keen on using something I don't really understand or know a lot about.</p>
  
  <p>It seems map is a very good alternative to vector&lt;> when there is often-occurring deletions, but I wanted to know if there are better alternatives to it.</p>
  
  <p>So is there a container that is both fast with random access and deletion?</p>
  
  <p>Is there an usual way to make an object pool?</p>