Boost logo

Boost :

From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2007-01-22 17:12:56


> I would be more than happy to help you understand the current library
> implementation, and suggest ways of reimplementing the dimensional
> analysis functionality at runtime.

No, I don't want this. As I indicated previously I think compile time
dimensional analysis checking is very important. I also don't want
runtime overhead of unit based checking...I have that now and hate it.
What I want to see is two features I believe are completely
complimentary. First, to be able to write equations in any set of units
but have zero, or next to zero, runtime overhead due to conversions.
Second, to have a value that will display and record in arbitrary units
that interacts seamlessly with the values being used in equations.

The first I see as being *partially* answered by your solution. It
would be fully realized if I could do the following:

static quantity<meters> const a_constant = 9.31 * ft;

In this case the conversion is only done once and this is an acceptable
overhead for my, and I believe most, cases. The equation can be written
in the language of the domain yet use a standard set of unit/dimension
pairs and be basically invisible to the developer and maintainer.

The second part I don't see being answered by your library at all. I do
have a solution in mind that should be perfectly complimentary to your
library iff your library can deal with arbitrary units. Basically what
you would end up with is something like:

length_table::quantity qty(length_table::ft) = f();

where f() is defined as:

units::quantity<length> f();

and the above constant:

static units::quantity<length> const a_const = 9.31 * length_table::ft;

I think such needs are going to be rather common but I don't see
documentation on how to accomplish it.


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