Suppose I write
std::vector littleVector(1);
std::vector bigVector;
bigVector.reserve(100);
bigVector = littleVector;
Does t
The only requirement on operator= for standard containers is that afterwards, src == dst, as specified in Table 96 (in 23.2, General Container Requirements). Furthermore, the same table specifies the meaning of operator ==:
distance(lhs.begin(), lhs.end()) == distance(rhs.begin(), rhs.end()) // same size
&& equal(lhs.begin(), lhs.end(), rhs.begin()) // element-wise equivalent
Note that this doesn't include capacity in any way. Nor does any other part of the standard mention capacity beyond the general invariant that capacity() >= size(). The value of capacity after assignment is therefore unspecified, and the container is free to implement assignment whichever way it wants, as long as allocator requirements are kept.
In general, you will find that implementations behave such that
Of course, move assignment is a different story. Since it is generally implemented by stealing the source storage, the capacity will be taken as well.