Can I initialize an STL vector with 10 of the same integer in an initializer list? My attempts so far have failed me.
The initialization list for vector is supported from C++0x. If you compiled with C++98
int number_of_elements = 10; int default_value = 1; std::vector vec(number_of_elements, default_value);