I know that the standard does not force std::vector to allocate contiguous memory blocks, but all implementations obey this nevertheless.
Suppo
Under the hood, a vector may look approximately like (p-code):
class vector {
T *data;
size_t s;
};
Now if you make a vector, there will be a layout like this
vector> --> data {
vector,
vector,
vector
};
or in "inlined" form
vector> --> data {
{data0, s0},
{data1, s1},
{data2, s2}
};
Yes, the vector-vector therefore uses contiguous memory, but no, not as you'd like it. It most probably stores an array of pointers (and some other variables) to external places.
The standard only requires that the data of a vector is contiguous, but not the vector as a whole.