Quantity.opEquals

Comparison with another quantity of the same unit.

  1. int opEquals(Quantity!(Unit, RhsV) rhs)
    struct Quantity(Unit, ValueType = double)
    int
    opEquals
    (
    RhsV
    )
    (
    Quantity!(Unit, RhsV) rhs
    )
    if (
    is(typeof(ValueType.init == RhsV.init) : bool)
    )
    if (
    isUnit!Unit
    )
  2. auto opCmp(Quantity!(Unit, RhsV) rhs)

Examples

auto a = 3 * metre;
auto b = 4 * metre;
auto c = 5 * second;
assert(a != b);
assert(a < b);
assert(!__traits(compiles, a != c));
assert(!__traits(compiles, a < c));

Meta