Boost logo

Boost :

From: Anatoli Tubman (anatoli_at_[hidden])
Date: 2001-08-14 03:12:45


A quantity library that wishes to support both metric
and English units must chose one of the following:

1. All length are stored in meters.
2. All length are stored in feet.
3. All length are stored in units specified at configure time.
4. Some lengths are stored in feet, others in meters.

Every choice has its problems. Choices 1 and 2 are giving unfair
preference to users of a particular unit system.
Choice 3 gives unfair preference to users of *two* particular
unit systems (unless you are willing to support every imaginable
unit system at configure time). Choice 4, like 3, gives unfair
preference to two particular unit systems -- but now to be fair
you have to either support every imaginable unit system at *run* time,
or support support every imaginable *set* of unit systems at configure
time.

We can see that it's hard to please everyone (surprise!). Given that,
chosing an applicable international standard is one of more sensible
decisions.

Another approach would be "don't please anyone". That is, provide
*dimensionality* library and several independent *example* unit
libraries (SI, English, Planck, whatever) on top of it. Users that want
unsupported units can supply their own unit library. Hopefully, with
ease.

Fortunately, it is really easy to refactor the proposed quantity library
to support this last approach.

On Monday 13 August 2001 21:41, Thomas Matelich wrote:
[snip]

-- 
anatoli at ptc dot com -- opinions are mine

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