quantities

The purpose of this small library is to perform automatic compile-time or run-time dimensional checking when dealing with quantities and units.

There is no actual distinction between units and quantities, so there are no distinct quantity and unit types. All operations are actually done on quantities. For example, meter is both the unit _meter_ and the quantity _1m_. New quantities can be derived from other ones using operators or dedicated functions.

Quantities can be parsed from strings at run time and compile time.

The main SI units and prefixes are predefined. Units with other dimensions can be defined by the user.

Modules

compiletime
module quantities.compiletime

This module quantities that are checked at compile-time for dimensional consistency.

runtime
module quantities.runtime

This module defines dimensionally variant quantities, for use mainly at run time.

si
module quantities.si

Importing quantities.si istantiate all the definitions of the SI units, prefixes, parsing functions and formatting functions, both at run-time and compile-time, storint their values as a double.

Public Imports

quantities.compiletime
public import quantities.compiletime;
Undocumented in source.
quantities.runtime
public import quantities.runtime;
Undocumented in source.
quantities.si
public import quantities.si;
Undocumented in source.

Meta

License

Boost License 1.0.