Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2003-10-24 04:21:14


"Ross MacGregor" <ross__macgregor_at_[hidden]> wrote in message
news:bn9mfr$uec$1_at_sea.gmane.org...

> 1) All units are represented as SI units by convention.
> 2) Each quantity has its own precision. Use longs, floats, double, or a
> custom type.
> 3) Each quantity uses a predefined dimention.
> 4) Each type provides a transformation to the base dimention (units).
> 5) Provides automatic type conversion of same dimention types.
> 6) Provides loss of precision warnings.
>

Of the list many things have been discussed higher up this thread and in the
dimensional analysis thread, so worth a look.

6) is to me the most important and problematic. There should be a means of
clear compile time error feedback to the user.
 Unfortunately as far as I know C++ templates do not (yet) provide a neat
mechanism for this.

note: I would be interested if anyone could point me to current research,
thinking or policy in this area...?

> Is such an entity possible?

See my demo for one approach:

http://www.servocomm.freeserve.co.uk/Cpp/physical_quantity/index.html

Please note that there are a lot of other examples about... some on boost...
also worth a look.

Andy Little
andy_at_[hidden]


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