operator + method

Priority operator +(
  1. int offset
)

Returns a priority relative to this priority.

A positive offset indicates a higher priority.

The parameter offset is clamped to ±kMaxOffset.

Implementation

Priority operator +(int offset) {
  if (offset.abs() > kMaxOffset) {
    // Clamp the input offset.
    offset = kMaxOffset * offset.sign;
  }
  return Priority._(_value + offset);
}