operator + method

NmPrice operator +(
  1. NmPrice other
)

Sum of two prices in the same currency.

Implementation

NmPrice operator +(NmPrice other) {
  assert(other.currency == currency, 'currency mismatch');
  return NmPrice(minor + other.minor, currency);
}