Introducing an “Unwrap or Throw” operator

I have been using this solution for ages and haven't felt a need for a custom operator or a method on Optional:

A standard UnexpectedNil error might be nice though.

7 Likes