Boost logo

Boost Users :

Subject: [Boost-users] multi_array: once more about a number of dimensions known only at runtime
From: Hicham Mouline (hicham_at_[hidden])
Date: 2010-05-16 05:26:28


Hello,
I have been directed to this discussion:
http://lists.boost.org/boost-users/2009/08/50601.php
when I asked this question before.

There are interesting solutions from OvermindDL1 and from Jesse Perla.

Basically, define a variant over all the possible multi_array types as:

template <typename T, std::size_t max_dim >
class multi_array_runtime_dims {

typedef variant<
  multi_array<T, 2>,
  multi_array<T, 3>,
...
  multi_array<T, max_dim>
> type;

};

Setting up the extents can be done at runtime as well.

I wonder if there has been further thought about the issue, and also what
the library designers thinks about it.

Regards,


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net