From: Larry Evans (cppljevans_at_[hidden])
Date: 2006-09-10 19:19:24
On 09/05/2006 08:36 AM, David Abrahams wrote:
> "Andy Little" <andy_at_[hidden]> writes:
>>Is it possible to use fusion to do a compile time matrix?
> Not directly, but there are at least two good ways to build one on top
> of fusion:
> 1. use a fusion vector of fusion vectors.
> 2. use a fusion vector augmented with a row length (assuming it's row-major).
The file array.cpp in vault/Template Metaprogramming has an array
of types (can be any rank) which maybe useful to Andy. One problem
is that there's no way (yet) to create a value from the array of types.
The array of types is specified with a shape vector(
mpl::vector_c<unsigned, T0, T1, ..., Tn> ) where
n is the rank-1 of the array of types. The array<Shape,TypeArray> has a
BOOST_CLASS_REQUIRE2(Shape,TypeArray) clause from the boost concepts
library which assures the TypeArray has the shape specified by Shape
(i.e. the vector_c<unsigned,...>).
Andy, please let me know if you'd be interested in using this or what
I'm planning on next. My next step is figuring how to generate the
values (IOW, just like fusion::vector has values corresponding to
mpl::vector [OK, actually they're template arguments to the
fusion::vector, but maybe you get my idea], there would be fusion::array
having values corresponding to array<Shape,TypeArray>).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk