NumberSetIterator
public struct NumberSetIterator<T> : IteratorProtocol where T : FixedWidthInteger, T : UnsignedInteger
An Iterator that return the elements of a NumberSet.
-
The elements returned by the
NumberSetIteratorare of typeInt.Declaration
Swift
public typealias Element = Int -
Creates a new iterator from the specified value.
Declaration
Swift
public init(rawValue: T)Parameters
rawValueAn unsigned
FixedWidhtIntegerwith a bit represeting each element that will be returned by the iterator. -
Advances to the next element and returns it, or
nilif no next element exists.The next element returned is represented by the lowest bit that is set and is cleared before returning. Once all of the bits are clear then all subsequent calls return
nil.Declaration
Swift
public mutating func next() -> Element?
View on GitHub
NumberSetIterator Structure Reference