Edited for brevity from source. pointee could have been avoided by an = 0. I bet it was decided against because people don't teach each other to recognize empty square brackets. ![]()
extension UnsafePointer where Pointee: ~Copyable {
@_alwaysEmitIntoClient public var pointee: Pointee {
@_transparent unsafeAddress { self }
}
}
extension UnsafePointer where Pointee: ~Copyable {
@_alwaysEmitIntoClient public subscript(i: Int) -> Pointee {
@_transparent unsafeAddress { self + i }
}
}