By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,655 Members | 1,860 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,655 IT Pros & Developers. It's quick & easy.

What are the advantages of using STL vectors over STL deque?

P: 12
What are the advantages of using STL vectors over STL deque?
Oct 5 '10 #1
Share this Question
Share on Google+
3 Replies


100+
P: 207
This web site has some information on the differences between a vector and deque.

http://www.cplusplus.com/reference/stl/deque/
Oct 5 '10 #2

P: 12
Thanks for the prompt reply. I have already gone through the above link.
However was not able to get any advantage of using vectors over dequeue. So was wondering what could be situation where vectors can be more efficient than dequeue?
Oct 5 '10 #3

100+
P: 687
the relevant part from the linked page is :
On the drawback side, unlike vectors, deques are not guaranteed to have all its elements in contiguous storage locations, eliminating thus the possibility of safe access through pointer arithmetics.
Oct 5 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.