I can't understand why I need ()
and hence where MyTypeQueOrdering
goes.
Here is header of PriorityQueue
, found on official github:
class PriorityQueue[A](implicit val ord: Ordering[A])
Here is my try (which works):
class MyType{
}
object MyTypeQueOrdering extends Ordering[MyType]{
def compare (n1:MyType, n2:MyType) = -1
}
class MyTypeQue extends PriorityQueue[MyType]()(MyTypeQueOrdering){
}
... but I can't figure out why I need ()
. Does PriorityQueue[MyType]()
return something?