std::vector<T> does not use the move constructor of T to change its capacity

Jonathan Wakely jwakely.gcc@gmail.com
Fri Jan 16 10:48:00 GMT 2015


On 16 January 2015 at 07:05, Jakub Galgonek wrote:
> On the other hand, if the copy constructor is deleted, than the move
> constructor is used to change the capacity. Also note that Visual
> Studio 2013 uses only move constructors in the both cases.

Apparently Visual Studio does not provide the strong exception-safety
guarantee for vector::reserve().

> Is this a gcc bug or is there some reason for this behaviour?

This is well-known behaviour, see e.g.
http://aristeia.com/EC++11-14/noexcept%202014-03-31.pdf



More information about the Libstdc++ mailing list