What advantage of use vectors in relation the deques?

Hi, What advantage of use vectors in relation the deques?
Read this:

http://www.cplusplus.com/reference/deque/deque/?kw=deque

Especially this:
Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of elements also at the beginning of the sequence, and not only at its end. But, unlike vectors, deques are not guaranteed to store all its elements in contiguous storage locations: accessing elements in a deque by offsetting a pointer to another element causes undefined behavior.


In other words: The contiguous storage would be the advantage.
Last edited on
Topic archived. No new replies allowed.