I want to have a dimensional agnostic template (usefull for both 3d and 4d), most of operations will be performed on submatrices with first dimension stripped.
So here is what I'd like to have
template <typename element, int dimensions>
class MMapMatrixTemplate{
public:
typedef boost::multi_array_ref<element, dimensions> array_type;
typedef std::array<size_t, dimensions> index_type;
typedef array_type::array_view<dimensions-1>::type stride_type;
};
Where array_type
defines array that is managed by this class index_type
defines type used to index arrays, and I'd like `stride_type
to define a slice of this array having one less dimension.
For now I get an error:
include/MMapMatrix.hh:31:55: error: non-template ‘array_view’ used as template
typedef boost::multi_array_ref<element, dimensions>::array_view<dimensions-1>::type stride_type;
^