Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::multi_array equivalent for runtime number of dimensions
From: alfC (alfredo.correa_at_[hidden])
Date: 2010-01-07 13:48:45


> I only know at runtime the dimension and extends of a multidimensional
> array, though the number of dimensions is always < 10 for e.g.
>
> Is there a container that allows this?

OvermindDL1 proposed to use boost.variant in thread called "question
about multi_array use" (see there for a more complete code).
for example:
typedef boost::variant
                <multi_array<int, 2>
                ,multi_array<int, 3>
                ,multi_array<int, 4>
                ,multi_array<int, 5>
                ,multi_array<int, 6>
                ,multi_array<int, 7>
                ,multi_array<int, 8>
> multi_array_variant_t;

and he says that using boost.fusion will be even better. I didn't try
it, but I would like to know if the solution really works well.

Alfredo.


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