Quantity.opCmp

Comparison with another quantity of the same unit.

struct Quantity(Unit, ValueType = double)
opCmp
(
RhsV
)
(
Quantity!(Unit, RhsV) rhs
)
if (
is(typeof(ValueType.init < RhsV.init) : bool)
)
if (
isUnit!Unit
)

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