The Units Of Measure Library

The purpose of this library is to try to make it more difficult to make coding mistakes that incorrectly mix units of measure. This is done with a set of C++ classes that provide type-safe manipulation of units of measure for various properties. The classes provide compile-time units checking as opposed to run-time checking.

Compile-time checking is far less difficult and expensive to track down errors. For example, if the developer tries to mix feet and meters, a compile-time error will result. Without the type-safe classes, this error would not be found until run-time (if at all!).

Extreme care was taken in designing this library so that the run-time execution using the classes does not suffer any penalty versus using native double precision types. For instance, the classes have no virtual functions, so the compiler does not generate a virtual table. The resulting memory footprint of the class is therefore the same as a double. And since the type checking is done at compile time, there is no run-time performance hit when using the classes.

Main Project Web Site

User Guide

SourceForge Logo