How can I create std::list
with a fixed element count?
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
.