title: Generic type with custom object in Swift language
body: <p>I wonder is there any way to compare two generic type instances with <code>==</code> operator in following generic function:</p>
  
  <pre><code> func compare&lt;T&gt;(T a, T b) -&gt; Bool {
      if a == b{
         // do something
         return true; 
      }else{
         // do another thing
         return false;
      }   
   }
  </code></pre>
  
  <p>Here is my custom object:</p>
  
  <pre><code>class MyObj{
    var id = 3
    var name: String?
  }
  </code></pre>