How does std::list allocate nodes vs. elements
问题 How does std::list allocate the nodes in which it keeps the next / prev pointers and the T element it contains? I think that standard allocators can only be used to allocate memory for one type (because std::allocator::allocate allocates memory in increments of sizeof(T) ). So it seems impossible to allocate the list node and the contained object in a single allocation, which means that the nodes have to be allocated with whatever the implementation decides, and the nodes store pointers to