         return "PriorityQueue(count: \(self.underestimatedCount)): \(Array(self))"
     }
 }
+
+extension PriorityQueue {
+  @available(*, deprecated, renamed: "Element")
+  public typealias T = Element
+  @available(*, deprecated, renamed: "PriorityQueue.Iterator")
+  public typealias PriorityQueueIterator<T: Comparable> = PriorityQueue<T>.Iterator
+}
+
+extension PriorityQueue.Iterator {
+  @available(*, deprecated, renamed: "Element")
+  public typealias T = Element
+}

}

extension PriorityQueue: Equatable {
    public static func ==(lhs: PriorityQueue<T>, rhs: PriorityQueue<T>) -> Bool {
        return Array(lhs) == Array(rhs)
    }
}

extension PriorityQueue: Sequence {
    public struct PriorityQueueIterator<T: Comparable>: IteratorProtocol {
        public typealias Element = T

        private var queue: PriorityQueue<T>
        fileprivate init(queue: PriorityQueue<T>) {
            self.queue = queue
        }

        public mutating func next() -> T? {
            return self.queue.pop()
        }
    }

    public typealias Element = T
    public typealias Iterator = PriorityQueueIterator<T>

    public func makeIterator() -> PriorityQueueIterator<Element> {
        return PriorityQueueIterator(queue: self)
    }
}


        return self.heap.storage.isEmpty
    }

    public mutating func pop() -> Element? {
        assert(self.heap.checkHeapProperty(), "broken heap: \(self.heap.debugDescription)")
        return self.heap.removeRoot()
    }
