title: How do you enumerate OptionSetType in Swift?
body: <p>I have a custom OptionSetType struct in Swift. How can I enumerate all values of an instance?</p>
  
  <p>This is my OptionSetType:</p>
  
  <pre><code>struct WeekdaySet: OptionSetType {
      let rawValue: UInt8
  
      init(rawValue: UInt8) {
          self.rawValue = rawValue
      }
  
      static let Sunday        = WeekdaySet(rawValue: 1 &lt;&lt; 0)
      static let Monday        = WeekdaySet(rawValue: 1 &lt;&lt; 1)
      static let Tuesday       = WeekdaySet(rawValue: 1 &lt;&lt; 2)
      static let Wednesday     = WeekdaySet(rawValue: 1 &lt;&lt; 3)
      static let Thursday      = WeekdaySet(rawValue: 1 &lt;&lt; 4)
      static let Friday        = WeekdaySet(rawValue: 1 &lt;&lt; 5)
      static let Saturday      = WeekdaySet(rawValue: 1 &lt;&lt; 6)
  }
  </code></pre>
  
  <p>I would like to something like this:</p>
  
  <pre><code>let weekdays: WeekdaySet = [.Monday, .Tuesday]
  for weekday in weekdays {
      // Do something with weekday
  }
  </code></pre>