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.
More Related Contents:
- stl::map assert [closed]
- What’s the difference between “STL” and “C++ Standard Library”?
- How can I use std::maps with user-defined types as key?
- std::vector::resize() vs. std::vector::reserve()
- How to convert wstring into string?
- Why use iterators instead of array indices?
- What requirements must std::map key classes meet to be valid keys?
- How to find if a given key exists in a C++ std::map
- Can standard container templates be instantiated with incomplete types?
- Is list::size() really O(n)?
- Sort list using STL sort function
- Heterogeneous containers in C++
- What does the standard library guarantee about self move assignment?
- How to declare a vector of atomic in C++
- How to filter items from a std::map? [duplicate]
- Is the use of std::vector objects in C++ acceptable, or should I use an alternative?
- std::optional specialization for reference types
- How do I store arrays in an STL list?
- How does std::copy work with stream iterators
- STL containers element destruction order
- What happens when you call data() on a std::vector?
- Are const_iterators faster?
- How to use the priority queue STL for objects?
- std::vector reserve() and push_back() is faster than resize() and array index, why?
- std::mutex performance compared to win32 CRITICAL_SECTION
- Vector Iterators Incompatible
- Why the libc++ std::vector internally keeps three pointers instead of one pointer and two sizes?
- Visual c++ “for each” portability
- Is stl vector concurrent read thread-safe?
- Should you overload swap in the std namespace?