Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2024-06-04 12:08:11


El 22/05/2024 a las 22:16, Ion Gaztañaga via Boost escribió:
> Hi,
>
>>> C) Swap is similar to a double move assignment.
>>
>> The interesting situation is when one vector uses a dynamic buffer and
>> the other one the internal buffer.
>> Currently swap allocates also a dynamic buffer for the vector with the
>> internal buffer.
>
>
> Thanks for pointing this out. If the memory from the vector using the
> dynamic buffer can be transferred (e.g. equal allocators or
> propagate_on_container_swap is true), then we should avoid a new
> allocation transferring elements to the internal buffer. I've updated
> the issue:
>
> https://github.com/boostorg/container/issues/279

The issues has been resolved. Now shrink_to_fit and swap should use the
internal storage when appropriate ;-)

Best,

Ion


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk