Context
While extending the Array type to conform to VectorArithmetic (for core animation experiment):
Code Block extension Array: VectorArithmetic where Element: VectorArithmetic & AdditiveArithmetic { ... }
I get the following error:
Code Block Referencing operator function '*' on '_VectorMath' requires that 'Element' conform to '_VectorMath'
and when calling the scale(by:) method:
Code Block Referencing instance method 'scale(by:)' on 'Array' requires that 'Double' conform to '_VectorMath'
Workaround
Making type Element and Double conform to _VectorMath fixed the issue:
Code Block extension Array: VectorArithmetic where Element: _VectorMath & VectorArithmetic & AdditiveArithmetic { ... }
Code Block swift extension Double: _VectorMath { }
Questions
I tried looking for information on _VectorMath (note the underscore prefix) but I could not find anything in the official docs and not much on the internet.
What is _VectorMath protocol?
Where is it defined?
Is it ok to use it like this?
Or should I use a different approach?