title: Filter array of classes in Swift
body: <p>I am trying to filter an array containing classes so that only the class that is found in another array will be added to an array. This is what I have so far:</p>
  
  <pre><code>class Match : Equatable {
  var name: String
  var value: String
  
  init(name: String, value: String) {
      self.name = name
      self.value = value
  }
  
  func ==(lhs: Match, rhs: Match) -&gt; Bool {
     return lhs.name == rhs.name &amp;&amp; lhs.value == rhs.value
  }
  
  // attempt to filter array containing Match structs
  
  let terms = [Match]()
  let someOtherObjects = [Match]()
  let sampleMatch = Match(name: "someName", value: "someValue")
  someOtherObjects.append(sampleMatch)
  
  filteredTerms = terms.filter { term in
     if attemptedCombos.contains(sampleMatch) {
        return true
     }
  }
  </code></pre>
  
  <p>However the compiler does not let me build with the error:</p>
  
  <blockquote>
    <p>"Cannot convert value of type 'Match' to expected argument type
    '@noescape (Match) throws -> Bool'</p>
  </blockquote>
  
  <p>Any ideas?</p>