I used std::vector
but it end up invalidating references upon on inserts then I moved to std::deque
which works great for inserts, but now the problem is that if I delete something middle of it, it end up invalidating the rest references.
Is there any container that doesn't invalidate references on both insertion and deletion?
If not, How can I achieve what I want?