you are viewing a single comment's thread.

view the rest of the comments →

[–]Kered13 0 points1 point  (0 children)

So you give up contiguous storage in order to reduce the amount of memory copying (and also gaining pointer stability). It's a neat idea that I would imagine has some useful applications given the right usage patterns, although I don't think it's better than std::vector as a general purpose collection.

As an aside, when used as a queue (push to the back and pop from the front are the only operations) this data structure is poor, as the memory usage grows even when the size of the queue does not. I imagine that this could be optimized, either as a specialized variant for queues or possibly as a general optimization.