Stated that there is no C++ equivalent of the C realloc
function, I've found in another question that such a thing is automatically managed by std::vector
and we should use it instead.
I'm fine with it. I guess that, since there is no other way of do reallocation, the std::vector
will just call realloc
for me.
However, the question is: if I'm overriding the new
and the delete
operators for managing of tracking memory usage globally, they will not be called in the case someone calls old C functions (malloc
, calloc
, realloc
, free
).
How can it be done? Is it correct that std::vector
replaces realloc
?