Created
          March 26, 2014 15:21 
        
      - 
      
- 
        Save mariuszklinger/9785861 to your computer and use it in GitHub Desktop. 
Revisions
- 
        mariuszklinger created this gist Mar 26, 2014 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ import scala.collection.mutable.PriorityQueue import scala.math.Ordering._ import scala.util.Sorting import Implicits._ class MyType{ } object Implicits { //implicit objects can't be top-level ones implicit object MyTypeQueOrdering extends Ordering[MyType] { def compare(n1: MyType, n2: MyType) = -1 } } class MyTypeQue extends PriorityQueue[MyType]{ } object Main { def main(args: Array[String]) = { val q = new MyTypeQue q += new MyType q += new MyType q += new MyType println(q.length) } }