pow

Raises a unit instance to a given power.

Because the exponent must be known at compile-time (as the type of the result depends on it), overloading the ^^ operator for units.

  1. auto pow(U u)
  2. auto pow(U u)
    @safe
    pow
    (
    int numerator
    uint denominator = 1u
    U
    )
    (
    U u
    )
    if (
    isUnit!U
    )
  3. auto pow(Q q)
  4. auto pow(Q q)

Examples

enum squareMetre = pow!2(metre);

Meta