Containers (Modern C++)
For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
By default, use vector as the preferred sequential container in C++. This is the equivalent of List<T> in .NET languages.
the array type when embedding is important - for example, as a class member.
unordered associative containers (unordered_map, et al.): Lower per-element overhead (major) and constant-time lookup (potentially major, sometimes minor). Harder to use correctly and efficiently, because of inconveniences and sharp edges.
sorted vector. (See: Algorithms.)
Don’t use C-style arrays. For older APIs that need direct access to the data, use
f( vec.data(), vec.size() ); instead.
For more information about containers, see C++ Standard Library Containers.