OptionSetType

protocol OptionSetType : SetAlgebraType, RawRepresentable
  • Convenience method for iterating over an option set.

    The calculation is performed by overflow multiplication &* 2 of Self.RawValue(1) as left shift (<<) is only defined for concrete integer types, not the UnsignedIntegerType this protocol is defined on.

    Note

    This method was originally detailed on StackOverflow

    Declaration

    Swift

    public func elements() -> AnySequence<Self>

    Return Value

    Any array of options.