Boost logo

Boost :

From: Neal Becker (ndbecker2_at_[hidden])
Date: 2006-12-18 14:43:16


To construct an array with a non-0 base, both the docs and the examples show
the use:

typedef typename boost::multi_array<flt_t,1> array1_t;
typedef typename array1_t::extent_range range1_t;
multi_array<flt_t,1> x (extents[range1_t (1, 10)]);

But this style is redundant if you have a number of array types (e.g,
various number of dimensions), because you would need a range_t for each
array type. But, there range_t aren't really different types.

After some searching I found
boost::multi_array_types::extent_range
was just what I needed. I don't think this appears in the docs or examples.
I suggest that this is the preferred approach, not the one shown above (and
in the multi_array docs and examples).


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk