extension PriorityQueue: GeneratorType { public typealias Element = T public func next() -> Element? { return pop() } }
Just iterating the elements causes the PriorityQueue to be cleared out.
If you use any of the swift functions that iterate over SequenceType, functions like contains() the queue also gets cleared.
extension PriorityQueue: GeneratorType { public typealias Element = T public func next() -> Element? { return pop() } }Just iterating the elements causes the PriorityQueue to be cleared out.
If you use any of the swift functions that iterate over SequenceType, functions like
contains()the queue also gets cleared.