Is it guaranteed that C++ standard library containers call the replaceable new functions?
问题 If I replace all the operator new signatures that I can, at least on the implementations I have tested, I see that the standard containers call into my replaced versions to allocate memory. Is this guaranteed by the standard? That is, would it be illegal for an implementation to use an optimized version which didn't call my replacement functions for the memory underlying the standard containers? 回答1: The default allocator for allocator-aware containers such as std::vector<T> is std::allocator