operator + method

Measure<D> operator +(
  1. Measure<Dimension> other
)

Implementation

Measure<D> operator +(Measure other) {
  num val;
  if (unit.hasScale && other.unit.hasScale) {
    val = other.val;
  } else {
    val = other.to(unit).val;
  }
  return Measure<D>(this.val + val, unit);
}