I'd like to create an extension for UnsafeMutablePointer
that only affects UnsafeMutablePointer<UInt8>
...
I understand that these instructions are pertinent, but I'm not sure how:
When you extend a generic type, you do not provide a type parameter list as part of the extension’s definition. Instead, the type parameter list from the original type definition is available within the body of the extension, and the original type parameter names are used to refer to the type parameters from the original definition.
Basically, I'm trying to use this method:
func toSwift(length: Int) -> [Int] {
var retVal : [Int] = []
for i in 0..<length {
retVal.append(Int(self[i]))
}
return retVal
}
to act on self
without the UnsafeMutablePointer<UInt8>
as a parameter... is this possible?