baseUnit

Shordhand for creating a basic unit with a name and a symbol, and no conversions defined.

When using BaseUnit, in virtually every use case, you also want to define an associated unit instance, as shown below. As there should be no real use for the unit type in user case anyway, you can also use baseUnit which directly returns a unit instance.

@safe
enum baseUnit (
string name
string symbol = null
)

Examples

alias BaseUnit!("Ampere", "A") Ampere;
enum ampere = Ampere.init;
// or
enum ampere = baseUnit!("Ampere", "A");

Meta