Initializing a vector of vectors having a fixed size with boost assign
assign, boost, c++, repeat, vector
Solution
This doesn't use `boost::assign` but does what you need:
vector<vector<int>> v(10, vector<int>(10,1));
This creates a vector containing 10 vectors of `int`, each containing 10 `ints`.
Problem
Having a vector of vector with a fixed size, ``` vector<vector<int> > v(10); ``` I would like to initialize it so that it has in all elements a one dimensional vector with initialized value (for example 1). I have used Boost Assign as follows ``` v = repeat(10,list_of(list_of(1))); ``` and I've got a compilation error ``` error: no matching function for call to ‘repeat(boost::assign_detail::generic_list<int>)’ ``` How can that be done?