Boost logo

Boost :

From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2007-02-19 11:44:39

Deane Yang wrote:
> Matthias Schabel wrote:
>>> 1) I do not need a library that insists on defining some "system of
>>> units" to which everything gets converted.
>> A major design goal of mcs::units was to allow users to work in a system
>> that matches their problem. These can be physical units, but can be
>> anything else, also...
> But I don't want the user of the library to have to define a "system" of
> units just to use a function in the library. If there is, say, a
> function that takes a distance, a mass, and a time and does computations
> with them, the user should be able to feed into that function arbitrary
> units for each of the three without having to use the dimensions library
> to define a system first.

In order to use the function the library would have to expose the
quantity type it uses - as such it would expose the system as well. It
would not be required to define the system yourself.

On the other hand, unless you write your own code in their system you'll
have to write conversion helpers to get into their system and of course
you have to write your own system. Even if you both use, say SI, but
define it yourselves you'll have to write helpers...they will do nothing
of importance but will be necessary I believe as you'll have unrelated
types that "mean" the same thing.

It's certainly not foolproof but I think the idea of a system has merit.
  It allows someone to write a library in say, SI, and provide the
interface to a user who assumes some other set of standard units and the
two will work together fairly easily.

Boost list run by bdawes at, gregod at, cpdaniel at, john at