Boost logo

Boost :

From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-10-10 14:37:52


| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]]On Behalf Of Andy Little
| Sent: Friday, October 03, 2003 4:55 PM
| To: boost_at_[hidden]
| 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_at_[hidden]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk