quantities.base

This module defines the base types for unit and quantity handling.

Members

Structs

Quantity
struct Quantity(N, Dimensions dims)

A quantity that can be represented as the product of a number and a set of dimensions. The number is stored internally as a member of type N, which is enforced to be a built-in numeric type (isNumeric!N is true). The dimensions are stored as a private struct that is equivalent to an associative array where keys are dimension symbols (e.g. "L" for length, "T" for time, etc.) and values are dimension exponents.

Templates

AreConsistent
template AreConsistent(Q1, Q2)

Check that two quantity types are dimensionally consistent.

isQuantity
template isQuantity(T)

Tests whether T is a quantity type

prefix
template prefix(alias factor)

Creates a new prefix function that mutlpy a Quantity by _factor factor.

unit
template unit(N, string symbol)

Creates a new monodimensional unit.

Meta

Authors

Nicolas Sicard