From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-10-10 14:37:48
There certaintly remains a need for a method of avoiding sending landers into
planet surface at the wrong speed!
The several previous proposals have never seemed to gather widespread Boost
support, often because of compiler problems, but also because many Boost users
do not work in the physical sciences area where dimensions and units are so
Now that the compiler situation is a bit more stable, it may be time to revisit
this issue, and the linked units problem, which your proposal does not appear to
Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
+44 1539 561830 Mobile +44 7714 33 02 04
| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]]On Behalf Of David Richardson
| Sent: Wednesday, October 08, 2003 8:23 PM
| To: boost_at_[hidden]
| Subject: [boost] Dimensional Analysis Interest?
| Is there any interest in a class for compile time checking of
| dimensional correctness of arithmetic expressions? It is a great
| debugging aid for scientific and engineering code.
| I've written a library that supports exponentiation, arithmetic,
| comparisons, and user defined units on a class that enforces
| dimensional correctness via its assignment and arithmetic
| operators. It can be used as
| Units<double>::Force f;
| Units<double>::Mass m(4.0);
| Units<double>::Acceleration a(3.0);
| f = m*a; //this is just fine
| f = m/a; //this will produce a compiler error.
| All of the validation is done at compile-time using templates.
| Theoretically this should mean there is no runtime overhead.
| There is also a preprocessor directive to completely turn off
| dimensional validation.
| There have been previous implementations of libraries like this,
| but they don't seem to be maintained anymore. They also don't
| appear to be advertised very much, as scientists and engineers
| I've talked to weren't aware of them. (see
| http://www.cs.binghamton.edu/~zdu/dim/ and the book C++ Scientific
| and Engineering C++ : An Introduction with Advanced Techniques and
| Making something like this more widely available would be useful
| for scientific programmers using C++. If there is any interest in
| this, I'd be willing to submit what I have for a formal review.
| David Richardson
| Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk