Daily bit(e) of C++ | std::vector
Daily bit(e) of C++ #307, The quintessential C++ container: std::vector.
std::vector is the quintessential C++ data structure.
It offers random access, low memory overhead and, due to the linear layout, is cache and branch-predictor friendly. This makes it often outperform more complex data structures.
Whenever picking a storage container, std::vector should be your first choice.