xor method

Option<T> xor(
  1. Option<T> optb
)
inherited

Returns Some if exactly one of this, optb is Some, otherwise returns None.

Implementation

Option<T> xor(Option<T> optb) {
  if (this is None) return optb;
  if (optb is None) return this as Option<T>;
  return None<T>();
}