title: Generic Addition Function Swift
body: <p>I want to make a function which could take two parameters and based on the type of the input it should perform binary operation(E.g. 'int' simple addition , for string it should concatenate etc..) and return the result . I am getting errors like "Binary operator ‘+’ can not be applied to two ’T’ operands" for following method </p>
  
  <pre><code>func commonAdd &lt;T&gt;(paramA:T,paramB:T)-&gt;T
  </code></pre>