I have a n-dimensional Boost.MultiArray I initialize as follows:
const int n=3, size=4; //# of dimensions and size of one dimension
boost::multi_array
Turns out, std::vector
has a constructor, that constructs a vector with a constant value repeated n times, so a possible solution looks like this:
const int n=2, size=4; //# of dimensions and size of one dimension
boost::multi_array arr(std::vector(n,size));
This initializes a n-dimensional multi_array with each dimension's size set to size.