4 ms·
There is a lesser known cousin to std::vector that doesn't have to move nor copy its elements when adding new elements, and that is std::deque.
by gsliepen 3y ago
There is a lesser known cousin to std::vector that doesn't have to move nor copy its elements when adding new elements, and that is std::deque.
- vardump 3y agoRight. But of course std::deque comes with a cost; iteration is slower and memory footprint is bigger.