|
Boost : |
From: Hugo Duncan (hugoduncan_at_[hidden])
Date: 2003-10-14 12:23:30
David Abrahams <dave_at_[hidden]> wrote:
> I don't see any MPL usage (other than conventions) in Hugo's
> example. Did you look at my slides?
I wouldn't like to try and implement it without MPL!
Having now looked at your slides, it is pretty much the same as
you propose, except that it does not use fixed dimensions,
instead using an explicit tag for each dimension.
So
typedef list_c<int,1,0,0,0,0,0,0> mass;
becomes
typedef vector< dimension_power< mass_tag, 1, 0> > mass;
or
typedef vector< dimension_power< mass_tag, rational<1,0> > > mass;
and
typedef list_c<int,0,1,-2,0,0,0,0> acceleration;
becomes
typedef vector< dimension_power< length_tag, 1, 0>
, dimension_power< time_tag, -2, 0>
> acceleration;
ie. the system is open to any number of dimensions.
Hugo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk