Last Updated: May 22, 2026
std::deque<T> is a double-ended queue: a sequence container that supports fast insertion and removal at both the front and the back. It's the container to choose when std::vector is almost right but the code also needs cheap front push and pop. This chapter covers how a deque is laid out in memory, the operations it offers, its complexity profile, and when to pick it over std::vector.