Why would I prefer using vector to deque

前端 未结 10 1721
陌清茗
陌清茗 2020-11-29 17:10

Since

  1. they are both contiguous memory containers;
  2. feature wise, deque has almost everything vector has but more, since it is more efficient to insert
10条回答
  •  北海茫月
    2020-11-29 17:54

    I think that good idea to make perfomance test of each case. And make decision relying on this tests.

    I'd prefer std::deque than std::vector in most cases.

提交回复
热议问题