This question already has an answer here:
- Why no push/pop in front of vector? 3 answers
std::vector::push_back() exists, why doesn't
std::vector::push_front() exist too?
I know there are others storage objects that work pretty much the same way and have an implementation of both
push_front() functions, but I was curious about the reason why
You don't want to push_front on a vector ever. Adding an element to the front means moving every single other element in the vector one element back: O(n) copying. Terrible performance.