I am looking for a standard container (if one exists) that will have a constant time for:
I can program it myself, but why bother, can it already exist in std?
std
std :: deque is your friend. This is a double queue with random access to items.
You can use std :: deque . It satisfies all your requirements.
It provides random access using random iterators as well operator []
operator []
pop_front()
push_back()