
I have a generic function which will take in a boost::multi_array of
dimension size N. I need to take slices along the M'th < N dimension (known
at compile time). I can't figure out how to do this with the multi_array
library and associated ranges/array_views. Is there another way to do this
rather than building a boost::indices object directly? Besides the sliced
dimension, I will always want the entire ranges for the other ones.
I believe the problem is that the index_gen object needs different types as
we build the indices in parts. The following code shows what a hardcoded
example would look like for N = 4 and M = 3
const std::size_t n_1 = 3;
const std::size_t n_2 = 4;
const std::size_t n_3 = 5;
const std::size_t n_4 = 6;
typedef boost::multi_array