Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-swift latest

Options.intersection(_:)

Returns a new option set with only the elements contained in both this set and the given set.

Source and package
Qualified name
RegexPattern.Options.intersection(_:)
Module
RegexPattern
Declared in
Options
Package
libtmux-swift
intersection(other: Self) -> Self

Inherited from OptionSet.intersection(_:)

Description#

This example uses the intersection(_:) method to limit the available shipping options to what can be used with a PO Box destination.

// Can only ship standard or priority to PO Boxes let poboxShipping: ShippingOptions = [.standard, .priority] let memberShipping: ShippingOptions = [.standard, .priority, .secondDay]

let availableOptions = memberShipping.intersection(poboxShipping) print(availableOptions.contains(.priority)) // Prints "true" print(availableOptions.contains(.secondDay)) // Prints "false"

  • Parameter other: An option set.
  • Returns: A new option set with only the elements contained in both this set and other.
Parameters
Esc

Type to search.

Reference previewOpen reference