|
Boost : |
From: David Richardson (dgr24_at_[hidden])
Date: 2003-10-13 08:25:11
> new_unit<>::acceleration gravity( 9.81 );
> new_unit<>::acceleration my_acc( ... );
>
> double d = my_acc / gravity ; // is this working ? it has no dimension.
You can currently do:
Units<double>::Acceleration gravity(9.81);
Units<double>::Acceleration my_acc(2.0);
Units<double>::Dimensionless d1;
double d2;
d1 = my_acc / gravity;
d2 = value(my_acc/gravity);
How do people feel about implicit conversion to allow:
d2 = my_acc / gravity;
or
d1 = 5.0;
David Richardson
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk