Function unit

Creates a new monodimensional unit as a QVariant.

QVariant!N unit(N) (
  string dimSymbol,
  size_t rank = size_t.max
);

Parameters

NameDescription
N The numeric type of the value part of the quantity.
dimSymbol The symbol of the dimension of this quantity.
rank The rank of the dimensions of this quantity in the dimension vector, when combining this quantity with other oned.

Example

enum meter = unit!double("L", 1);
enum kilogram = unit!double("M", 2);
// Dimensions will be in this order: L M