[Bug libstdc++/86013] std::vector::shrink_to_fit() could sometimes use realloc()

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jun 3 19:53:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86013

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The standard specifically says that if reallocation occurs then iterators and
points are invalidated, which is how it talks about copying to new storage.

You are making up an interpretation for shrink_to_fit which is novel, not
supported by the standard, and not intended by the designers of the feature.


More information about the Gcc-bugs mailing list