 }
 
 extension PriorityQueue: Equatable {
-    public static func ==(lhs: PriorityQueue<T>, rhs: PriorityQueue<T>) -> Bool {
+    public static func ==(lhs: PriorityQueue<Element>, rhs: PriorityQueue<Element>) -> Bool {
         return Array(lhs) == Array(rhs)
     }
 }
 
 extension PriorityQueue: Sequence {
-    public struct PriorityQueueIterator<T: Comparable>: IteratorProtocol {
-        public typealias Element = T
+    public struct Iterator: IteratorProtocol {
 
-        private var queue: PriorityQueue<T>
-        fileprivate init(queue: PriorityQueue<T>) {
+        private var queue: PriorityQueue<Element>
+        fileprivate init(queue: PriorityQueue<Element>) {
             self.queue = queue
         }
 
-        public mutating func next() -> T? {
+        public mutating func next() -> Element? {
             return self.queue.pop()
         }
     }
 
-    public typealias Element = T
-    public typealias Iterator = PriorityQueueIterator<T>
-
-    public func makeIterator() -> PriorityQueueIterator<Element> {
-        return PriorityQueueIterator(queue: self)
+    public func makeIterator() -> Iterator {
+        return Iterator(queue: self)
     }
 }
 

        return self.heap.storage.isEmpty
    }

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

        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
}
