Skip to content

Instantly share code, notes, and snippets.

@nahive
Last active April 21, 2017 02:17
Show Gist options
  • Save nahive/5a768302a298d0a0fcd0bb7126041d8f to your computer and use it in GitHub Desktop.
Save nahive/5a768302a298d0a0fcd0bb7126041d8f to your computer and use it in GitHub Desktop.
/// Returns a Boolean value indicating whether a value is included in a
/// range.
///
/// You can use this pattern matching operator (`~=`) to test whether a value
/// is included in a range. The following example uses the `~=` operator to
/// test whether an integer is included in a range of single-digit numbers.
public static func ~=(pattern: ClosedRange<Bound>, value: Bound) -> Bool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment