Quantity.isConsistentWith

Tests wheter this quantity has the same dimensions as another one.

struct Quantity(N, Dim...)
const
bool
isConsistentWith
(
Q
)
()

Examples

auto nm = (1.4 * newton) * (0.5 * centi(meter));
auto kWh = (4000 * kilo(watt)) * (1200 * hour);
assert(nm.isConsistentWith(kWh)); // Energy in both cases
assert(!nm.isConsistentWith(second));

Meta