title: How to add OR condition in Swift generic where clause?
body: <p>I am extending <a href="https://developer.apple.com/documentation/scenekit/scnvector3" rel="noreferrer">SCNVector3</a> from Apple SceneKit with arithmetic operations with a number.  I use generic for the number's type, but I have found out that I have to write at least two versions of each function, as this does not work:</p>
  
  <pre><code>extension SCNVector3 {
      static func *&lt;T&gt; (left: SCNVector3, right: T) -&gt; SCNVector3 {
          return SCNVector3(left.x * Float(right), left.y * Float(right), left.z * Float(right))
  }
  </code></pre>
  
  <p>and gives error <strong>Cannot invoke initializer for Type 'Float' with an argument list of type '(T)'</strong></p>
  
  <p>Looking at <a href="https://developer.apple.com/documentation/swift/float" rel="noreferrer">definition</a> of Float in Apple documentation, I see that the most generic I can get is <code>init&lt;Source: BinaryFloatingPoint&gt;</code> or <code>init&lt;Source: BinaryInteger&gt;</code>.</p>
  
  <p>So I have to rewrite the extension as following, making two almost identical functions for each operation:</p>
  
  <pre><code>extension SCNVector3 {
      static func *&lt;T&gt; (left: SCNVector3, right: T) -&gt; SCNVector3 where T: BinaryFloatingPoint {
          return SCNVector3(left.x * Float(right), left.y * Float(right), left.z * Float(right))
  
      static func *&lt;T&gt; (left: SCNVector3, right: T) -&gt; SCNVector3 where T: BinaryInteger {
          return SCNVector3(left.x * Float(right), left.y * Float(right), left.z * Float(right))
  }
  </code></pre>
  
  <p>I can place AND in <code>where</code> clause — by having two conditions after <code>where</code> separated by a comma.</p>
  
  <p>But is there any way I can place OR there?</p>