> It's four goddamn bytes. Or eight if you really want more than 4 billion elements.
As long as you don't have millions of lists with a few elements each -- you can't presume that they are only used one way :)
As long as you don't have millions of lists with a few elements each -- you can't presume that they are only used one way :)
That may make 'splice' slower. See http://home.roadrunner.com/~hinnant/On_list_size.html (I think that could be solved by having list iterators carry a field pointing to their container, but haven't given it much thought. Corrections welcome)
Storing an index in the iterator would not be a solution either. That would mean updating the index in all the existing iterators when you insert an object in the list.
libc++ has the luxury of assuming c++11.
Hell, you probably lose that much to padding somewhere anyways.