PrefixedUnit

A unit with a scaling prefix applied, e.g. kilo(metre).

There is conceptually no difference between defining a regular conversion and prefixing a unit. However, PrefixedUnit automatically generates the name of the new unit, and it is able to fold multiple prefixes of the same system, e.g. milli(kilo(metre)) to just metre.

  1. struct PrefixedUnit(BaseUnit, int exponent, alias System)
  2. template PrefixedUnit(BaseUnit, int exponent, alias System)
    @safe
    template PrefixedUnit (
    BaseUnit
    int exponent
    alias System
    ) if (
    isPrefixedUnit!BaseUnit &&
    (BaseUnit.prefixBase == System.base)
    ) {}
  3. template PrefixedUnit(alias baseUnit, int exponent, alias System)

Members

Aliases

PrefixedUnit
alias PrefixedUnit = BaseUnit.Base
Undocumented in source.
PrefixedUnit
alias PrefixedUnit = PrefixedUnit!(BaseUnit.Base, exponent + BaseUnit.prefix.exponent, System)
Undocumented in source.

Meta