unit

Creates a new monodimensional unit.

template unit (
N
string symbol
) {}

Members

Manifest constants

unit
enum unit;
Undocumented in source.

Variables

one
enum N one;
Undocumented in source.

Examples

enum euro = unit!(double, "C"); // C for Currency
static assert(isQuantity!(typeof(euro)));
enum dollar = euro / 1.35;
assert((1.35 * dollar).value(euro).approxEqual(1));

Meta