From: Larry Evans (cppljevans_at_[hidden])
Date: 2006-09-17 11:54:43
On 09/17/2006 09:16 AM, Andy Little wrote:
> "Larry Evans" <cppljevans_at_[hidden]> wrote in message
>>On 09/05/2006 08:36 AM, David Abrahams wrote:
>>>1. use a fusion vector of fusion vectors.
>>It suddenly dawned on me that 1 above seems a pretty simple solution.
>>Is there some reason for not using 1?
> Well, Lets assume that you could use one infinitely long sequence. That is
> slightly simpler (IMO) because it would work exactly the same for any size
> matrix, iow each could have the same representation, which might be something
> matrix<rows, columns, sequence>
> which actually is what I am currently going for.
> I havent tried the alternative., but I suspect that the metaprogramming of it
> would be more complicated.
> Ultimately I suppose the interface should be separated from the implementation
> and it should work for both, however I'm certainly not planning something
Let's see if I understand. First, shorthand:
rank2_method means the fusion vector of fusion vector method.
rank1_method means the existing method as illustrated in OP.
One thing that would be more complicated with rank2_method
vs. rank1_method is the initialization interface. IOW with the
rank1_method there's this initialization interface:
typedef tuples::tuple<T0_0,T0_1,T1_0,T1_1> rank1_type;
where rank1_type was matrix_elements in the OP.
With rank2_method, the iterface would be:
typedef fusion::vector<T0_0,T0_1> rank1_0_type;
typedef fusion::vector<T1_0,T1_1> rank1_1_type;
typedef fusion::vector<rank1_0_type,rank1_1_type> rank2_type;
So, the extra complexity the rank2_method is more typing;
however, that buys you, IMO, clearer code.
(WARNING: above code has not been compiled)
Is there something I'm missing?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk