Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2006-11-02 18:19:28

I've posted v0.5 of mcs::units along with updated documentation in
the Vault/Units directory. This version has only been tested under
gcc 4.0.1. I have attempted to put #define guards in appropriate
places to accommodate compilers that don't support typeof, but some
examples may not compile without it. There have been a number of
changes and improvements since the previous version:

1) The biggest change is in the syntax for quantities. Rather than
hiding quantity typedefs within a class templated on value type like
the previous version (e.g. SI<double>::length), quantities are now in
the open : quantity<double,SI::length>, with the unit definitions for
each system being declared in a namespace. This significantly
simplifies some things and, if anything, makes the code more self-
documenting, IMO. Very little of the underlying code has changed

2) Implementation of rational and integer powers and roots have been
streamlined and now work in most test cases.

3) An example of interoperability of mcs::units with
boost::math::quaternion has been added.

4) A partial reimplementation of std::complex that supports
heterogeneous operators, and allows complex to be a value type of
quantity or quantity to be a value type of complex, has been added as
an example. This example demonstrates the implementation steps
necessary to make a user-defined type that is completely
interoperable with mcs::units. Both quantity<complex<Y>,Unit> and
complex<quantity<Y,Unit> > function, and all operators including
rational powers and roots behave as expected.

5) A number of physical constants from the CODATA tables have been
added (currently only function with typeof).

As always, feedback is welcomed.


Matthias Schabel, Ph.D.
Assistant Professor, Department of Radiology
Utah Center for Advanced Imaging Research
729 Arapeen Drive
Salt Lake City, UT 84108
801-587-9413 (work)
801-585-3592 (fax)
801-706-5760 (cell)
801-484-0811 (home)
matthias at stanfordalumni dot org

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