哪个 STL 容器最适合我的需要?我基本上有一个10个元素宽的容器,其中我不断地使用 push_back
新元素,而 pop_front
是最老的元素(大约100万次)。
I am currently using a std::deque
for the task but was wondering if a std::list
would be more efficient since I wouldn't need to reallocate itself (or maybe I'm mistaking a std::deque
for a std::vector
?). Or is there an even more efficient container for my need?
另外,我不需要随机访问