For std::vector\'s copy assignment, is reallocation of storage and shrink of capacity allowed when the source\'s size is smaller than the destination\'s capacity? Or is it
To answer your PS: At least for std::string, you cannot assume that the handling of strings are similar to the handling of a vector of chararacters.
std::string
COW (Copy-on-Write) is not mandatory to implement string, and not all library-implementations do this.