title: Swift generics *= operator error
body: <p>I have the following simple struct type.</p>
  
  <pre><code>import Foundation
  import SceneKit
  
  protocol Named {
      class var name: String { get }
  }
  
  extension Float: Named {
      static var name: String { return "Float" }
  }
  
  struct Vector3&lt;T: protocol&lt;Named, FloatingPointType&gt;&gt;: Printable { // This protocol solves the generics issue
      // Properties
      var x, y, z: T
      var description: String {
          return "Vector3&lt;\(T.name)&gt;(\(x), \(y), \(z))"
      }
      // Methods - mutating
      mutating func factored(factor: T) {
          x *= factor
      }
  
  }
  </code></pre>
  
  <p>I want to be able to take as a parameter to <code>factored</code> the same type the struct was created with. But this results with a <code>Cannot invoke *= with an argument list of type (T, T)</code>.</p>
  
  <p>Do I need to implement the <code>*=</code> operator, along with any other I end up needing? How would I do that?</p>
  
  <h2>Edit</h2>
  
  <p>After @matt gave a suggestion to just declare Vector3 as adhering to the <code>FloatingPointType</code> protocol it solved the issue. Though now I'm getting a <code>T is not identical to UInt8</code> inside the <code>factored</code> method.</p>