This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: vector<> can probably never grow to it's maximum size!
On Mon, Oct 18, 2004 at 06:59:28PM +0530, Dhruv Matani wrote:
> 4. The post on google also hints at changing the behaviour of
> new_allocator<> for in-built types so that copying is not required if
> realloc is used. This is probably a not so related issue, so clubbing
> these would probably not be right.
But it also explains why realloc() is not possible for C++ objects.
You need something other than realloc, so that if the existing block
can't be grown then allocation fails. You must not allocate a new block
and move the contents.
jon
--
"Whenever you find that you are on the side of the majority,
it is time to reform."
- Mark Twain