Why is there no reallocation functionality in C++ allocators?
In C the standard memory handling functions are malloc() , realloc() and free() . However, C++ stdlib allocators only parallel two of them: there is no reallocation function. Of course, it would not be possible to do exactly the same as realloc() , because simply copying memory is not appropriate for non-aggregate types. But would there be a problem with, say, this function: bool reallocate (pointer ptr, size_type num_now, size_type num_requested); where ptr is previously allocated with the same allocator for num_now objects; num_requested >= num_now ; and semantics as follows: if allocator