For the Standard allocator interface for use in, say, std::vector
, is re-allocation supported? I have a rather specific use-case in which being able to reallo
I believe that realloc()
is not part of the STL allocator interface. But realloc()
is always a crap-shoot anyway, since you don't really know whether your OS will expand your allocation or move you to a new one. Actual performance is very OS-dependent. If you know you want to reallocate, you might as well just alloc a bigger chunk of memory in advance, which luckily the STL makes easy.
Do you have a use case where this would be undesirable?