Container with constant time for accessing any element, pop from front and push back?

c++, containers, std

Solution

std::deque is your friend. It's a double-ended queue with random access to elements.

Problem

I'm looking for standard container (if any exists) that will have constant time for: - access any element by position - pop element from the front - push element at back I can program it by myself, but why bother if it could already exist in `std`?

Original source

Related problems