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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shilpa Sethi
    New Member
    • Aug 2010
    • 12

    #1

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

    What are the advantages of using STL vectors over STL deque?
  • hype261
    New Member
    • Apr 2010
    • 207

    #2
    This web site has some information on the differences between a vector and deque.

    Comment

    • Shilpa Sethi
      New Member
      • Aug 2010
      • 12

      #3
      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?

      Comment

      • newb16
        Contributor
        • Jul 2008
        • 687

        #4
        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.

        Comment

        Working...