I read that std::vector
should be contiguous. My understanding is, that its elements should be stored together, not spread out across the memory. I have simply acce
std::vector
being a contiguous container means exactly what you think it means.
However, many operations on a vector can re-locate that entire piece of memory.
One common case is when you add element to it, the vector must grow, it can re-allocate and copy all elements to another contiguous piece of memory.