How does std::list highlight the nodes where it stores next / prev pointers and the T element it contains?
I think that standard allocators can only be used to allocate memory for one type (since std::allocator::allocate allocates memory in increments of sizeof(T) ). Thus, it is not possible to select the node list and the contained object in one distribution, which means that the nodes must be distributed with what the implementation decides, and the nodes store pointers to objects instead of the objects themselves and this implies two levels of indirection to get from a pointer to list node to the object it contains, which seems inefficient. Is that the case?
source share