I have an unusual set of requirements for my C++ application. I need a container that:
std::vectorIs there a data-structure with these properties?
There is std::deque that matches your requirements:
std::deque(double-ended queue) is an indexed sequence container that allows fast insertion and deletion at both its beginning and its end. In addition, insertion and deletion at either end of a deque never invalidates pointers or references to the rest of the elements.
Also, std::list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With