How is C++ std::vector implemented?

It’s implemented by using an underlying array.

It’s not possible to implement a std::vector<T> with a linked list because the standard guarantees the elements in the list will be held in contiguous memory.

Leave a Comment