list or container O(1)-ish insertion/deletion performance, with array semantics
问题 I'm looking for a collection that offers list semantics, but also allows array semantics. Say I have a list with the following items: apple orange carrot pear then my container array would: container[0] == apple container[1] == orangle container[2] == carrot Then say I delete the orange element: container[0] == apple container[1] == carrot I want to collapse gaps in the array without having to do an explicit resizing, Ie if I delete container[0], then the container collapses, so that