This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: About std::vector::resize().


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]