std::list fixed size

0xAX picture 0xAX · Oct 11, 2010 · Viewed 10.7k times · Source

How can I create std::list with a fixed element count?

Answer

sth picture sth · Oct 11, 2010

If you just want a fixed size container, maybe you are looking for std::tr1::array. (Or just std::array for C++0x.)

If you don't insert or remove elements I don't think there is any advantage in using std::list instead of std::array or std::vector.