The way deque works, there is no difference in performance or invalidation behaviour between pre-allocating and allocating when needed. Thus, it is not possible to explicitly pre-allocate.