I think you should check this SO post: In which scenario do I use a particular STL container? for small sizes vector will suit most scenarios irrespective of what you intend to do.
The chart is a guide though, the fact that the container is accessed regularly does not affect container choice, the fact that you are storing int is unimportant unless you care about the size of the container, in which case does the overhead of the pointers in a list container or map matter to you?
Sorting is done automatically by map but sorting a vector and list can be very fast if the container size is small enough to fit in memory.
Data insertion is optimised for lists and maps anywhere in the container, for maps you get the benefit that it will sort itself but again if the size is small enough then constructing a new vector with the new entry could be very fast still.
You may also want to consider hash maps, you would still be best to profile your code, trying to second guess what is optimal depends on your usage and you really need to measure and profile.
You could also just decide that an STL <map>
is a fine enough balance or a <set>
and use those containers as they automatically sort on insertion and deletion and look up is fast but there is the overhead of maintaining the pointers in each entry that increases the size of the memory used compared to vector, if you don't care about this then you could consider these containers.
Still if it matters then test and profile and compare the performance of each container, you will be surprised by how the code will perform against your assumptions.