std::string::reserve vs std::vector::reserve

Peter Soetens peter.soetens@mech.kuleuven.be
Thu Jun 16 11:35:00 GMT 2005


On Thursday 16 June 2005 13:21, Jonathan Wakely wrote:
>
> The standard was written explicitly so that COW strings would be
> possible (some implementors have since objected that it's worded to make
> non-ref-counted strings too difficult!)
>
> The only requirement on std::string::operator= is that capacity() should
> return "a value at least as large as size()", which libstdc++'s
> implementation does.
>

Thank you for this informative answer !

Peter Soetens

-- 
K.U.Leuven, Mechanical Engineering, Robotics Research Group
<http://www.orocos.org> Tel: +32 16 322772



More information about the Libstdc++ mailing list