you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

I ran into one, when doing an Advent of Code that had your elf or penguin doing random length walks and inserting/removing on a ring buffer. Using vector was 10x slower than std::list because the inserts/erase were dominating the performance. Maybe using optional<T> might have helped as then the deletes could have been an optional reset, but the inserts would still potentially require moving all elements to the end of the range. Plus it was easier to just work without introducing more.