Does someone know the way to define constant-sized vector?
For example, instead of defining
std::vector
it will be
There is no way to define a constant size vector. If you know the size at compile time, you could use C++11's std::array aggregate.
#include <array>
std::array<int, 10> a;
If you don't have the relevant C++11 support, you could use the TR1 version:
#include <tr1/array>
std::tr1::array<int, 10> a;
or boost::array, as has been suggested in other answers.