因此在实际使用时,如何选择这三个容器中哪一个,应根据你的需要而定,一般应遵循下面 的原则: 1.如果你需要高效的随即存取,而不在乎插入和删除的效率,使用vector 2.如果你需要大量的插入和删除,而不关心随即存取,则应使用list 3.如果你需要随即存取,而且关心两端数据的插入和删除,则应使用deque. MSDN: 1. Introduction The STL vector class is a template class of sequence containers tha…
1. Headers should not include using declaration Code inside headers ordinarily should not include using declarations. The reason is that the contents of a header are copied into the including program's text. If a header has a using declaration, then…
list vector deque stack queue priority_queue set [unordered_set] map [unordered_map] multimap [unordered_multimap] contiguous storage double-ended queue LIFO FIFO 1st is greatest Iterators X X X Element access push_back push_b…