About std::vector::resize().

Martin Sebor sebor@roguewave.com
Tue May 25 21:01:00 GMT 2004


Paolo Carlini wrote:

> Martin Sebor wrote:
> 
>>     T *p = &v [0];
>>     v.resize (n);   // must not reallocate
>>     assert (&v [0] == p);
> 
> 
> Interestingly, this requirement doesn't exist for basic_string (the 
> famous 21.3, p5)

Because if it did, it would prevent reference-counted implementations.

Martin



More information about the Libstdc++ mailing list