vector<> can probably never grow to it's maximum size!
Jonathan Wakely
cow@compsoc.man.ac.uk
Mon Oct 18 15:28:00 GMT 2004
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
More information about the Libstdc++
mailing list