|
Boost : |
From: Hugo Duncan (hugoduncan_at_[hidden])
Date: 2003-10-27 10:16:56
Ross MacGregor <ross__macgregor_at_[hidden]> wrote:
> Hugo Duncan wrote:
>> Trying to encode the conversion factors into the type signature
>> seems ugly to me. Unit conversion takes place from one unit to another
>> and this can be expressed directly (untested code below).
>
> Would this lead to an explosion of converters?
I was just trying to define an interface. The interface could be
implemented as you describe below.
> My original idea was each unit would define its relationship to the
> standard SI unit. Therefore the transform algorithm will need to work
> both ways:
>
> meter -> T() -> kilometer
> kilometer -> -T() -> meter
>
> Convertion between two units would then require a two step precess.
>
> kilometer -> -T() -> meter -> T() -> centimeter
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk