What’s the advantage of using std::allocator instead of new in C++?
In my opinion, it is more complicated to use it instead of using new and delete. Yes, but it is not meant to replace new and delete, it serves a different purpose. With allocator we must explicitly allocate heap memory, construct it, destroy it, and then finally deallocate the memory. So why was it created? … Read more