The advice “never use std::list” is wrong. I measured std::list in multiple synthetic scenarios and found cases where it beats std::vector easily — with a low number of elements and small element sizes. Modern memory allocators are surprisingly good and can place data sequentially. The only overhead in that case is two extra pointers. People referring to Bjarne Stroustrup’s 2012 talk make the dogmatic decision to never use std::list. He tried to correct this in his 2014 blog post, emphasizing the same point I am making: measure first, don’t guess. But the damage was done. TL;DR: if std::list is faster than std::vector in your case, simply use std::list.

Previous