title: Usage of arithmetic operants (+, -, /, *) with generic types
body: <p>I have a problem with a class using a generic type T for an internal array which can be an <code>Int</code> or <code>Double</code>. The function <code>average</code> shall calcucualte the average values of all <code>Int</code> or <code>Double</code> values in the array. </p>
  
  <pre><code>class MathStatistics&lt;T: Comparable&gt; {
      var numbers = [T]()
  
      func average() -&gt; Double? {
          if numbers.count == 0 {
              return nil
          }
  
          var sum:T
  
          for value in numbers {
             sum = sum + value
          }
  
          return (sum / numbers.count)
      }
  }
  </code></pre>
  
  <p>Xcode reports an error in line the following lines:</p>
  
  <p><code>sum = sum + value</code>
  Binary operator '+' cannot apply two T operants</p>
  
  <p><code>return (sum / numbers.count)</code>
  Couldn't find an overload for '/' that accepts the supplied arguments</p>