The sequence containers keep the elements in the order you specify when adding the elements to the container. The sequence containers are std::array, std::vector, std::deque, std::basic_string, std::list, and std::forward_list. Things you need to know before choosing a sequence container are as follows:
- Number of elements (order of magnitude).
- Usage patterns: How often are you going to add data? Read/traverse data? Delete data? Rearrange data?
- Do you need to sort the elements?
When adding elements to a sequence container, you always specify where in the sequence the should be located. For example, when adding an element to a vector you can call push_back, which will add the new element last in the container.