RE: [boost] Physical Quantities revisited
by Paul A. Bristow other posts by this author
Oct 10 2003 7:37PM messages near this date
RE: [boost] Physical Quantities revisited
|
[boost] Re: Physical Quantities revisited
| -----Original Message-----
| From: boost-bounces@[...].org
| [mailto:boost-bounces@[...].org]On Behalf Of Andy Little
| Sent: Friday, October 03, 2003 4:55 PM
| To: boost@[...].org
| Subject: [boost] Physical Quantities revisited
| I have also had requests from users for ability to work
| in (say) feet and inches etc rather than s.i. units.
|
| I have had a look at various physical quantities libraries
| including the "quantities" library at boost,
| and SIunits at
| http://www.fnal.gov/docs/working-groups/fpcltf/Pkg/SIunits/doc/0SIunits.html
|
| but they have an odd syntax.
|
| ie both do something like:
|
| length mylength = 20 * metres(); // here length is a type
|
| whereas what would seem to be more useful would be:
|
| metres myLength(20); // here metres is the type
| //*1 see footnote on explicit ctor
|
| The critical difference here is that the type is the
| unit of dimension, rather than the dimension itself.
| As a programmer if I want to know the units
| of a variable they are encoded in the type
| and if I can't decipher them I can do a conversion:
My recollection is that the consensus of previous discussions was that getting
all the values into SI units for all interval calculations was the preferred
strategy.
And I still believe that this has most advantages.
Only on input or output would other units, like multiples and/or Imperial be
used.
Paul
Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
+44 1539 561830 Mobile +44 7714 33 02 04
mailto:pbristow@[...].com
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Andy Little
Andy Little
Andy Little
Andy Little
Andy Little
Andy Little
Andy Little
Jan Langer
Andy Little
Deane Yang
Paul A. Bristow
Phil Richards
Rene Jager
Deane Yang
Phil Richards
Andy Little
Deane Yang
Brock Peabody
Paul A. Bristow
Andy Little
Andy Little
Matthias Troyer
Paul A. Bristow
Ross MacGregor
Deane Yang
Paul A. Bristow
Deane Yang
Paul A. Bristow
Paul A. Bristow
David Abrahams
Jonathan de Halleux
Philip Miller
Deane Yang
Paul A. Bristow
Paul A. Bristow
David Abrahams
|