title: Swift: How to remove item from a Set of custom objects based on custom condition (higher order function)
body: <p>Let's assume I have a <code>Set</code> of Custom objects (i.e. Person), something like this:</p>
  
  <pre><code>struct Person: Hashable {
  let name: String
  let age: Int
  }
  
  let persons: Set&lt;Person&gt; = [Person(name: "Willy", age: 25), Person(name: "Jenny", age: 22)]
  </code></pre>
  
  <p>If I was to remove all items that have a specific name, I cannot find a <code>Set</code> method for this case. 
  In <code>Array</code> there is such a method called:</p>
  
  <pre><code>@inlinable public mutating func removeAll(where shouldBeRemoved: (Element) throws -&gt; Bool) rethrows
  </code></pre>
  
  <p>But for some reason I cannot find an equivalent in <code>Set</code>.</p>
  
  <p>So my solution was to perform a quick conversion for the removing procees something like this:</p>
  
  <pre><code>var arr = Array(persons)
  
  arr.removeAll {
      $0.name == "Willy"
  }
  
  persons = Set(arr)
  </code></pre>
  
  <p>Is there any direct solution In <code>Set</code> rather than using <code>Array</code> as a middle-man?</p>