title: How to pass a class method as a parameter in Scala
body: <p>Lets say I have a class C with some methods</p>
  
  <pre><code>def class C {
    def f1():Int = ...
    def f2():Int = ...
  }
  </code></pre>
  
  <p>Now I'd like a method that takes two instances of C, as well as a method of C, but I don't know what the types of f1, f2 are, nor how to invoke them. I'm thinking it would look something like</p>
  
  <pre><code>def cmp(first:C, second:C, t:() =&gt; Int): Boolean = {
    first.t &lt; second.t
  }
  </code></pre>
  
  <p>This complains that t is not a method of C. Surely there must be a way to express this.</p>