@@ -68,7 +68,7 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
68
68
_rawValue = other. _rawValue
69
69
}
70
70
71
- /// Convert an Unsafe${Mutable}Pointer ${a_Self}.
71
+ /// Convert an Unsafe${Mutable}Pointer to ${a_Self}.
72
72
///
73
73
/// Returns nil if `other` is nil.
74
74
@_transparent
@@ -77,14 +77,29 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
77
77
_rawValue = unwrapped. _rawValue
78
78
}
79
79
80
- % if not mutable:
81
- /// Convert an UnsafeMutableRawPointer ${a_Self}.
80
+ % if mutable:
81
+ /// Convert an UnsafeRawPointer to ${a_Self}.
82
+ @_transparent
83
+ public init ( mutating other: UnsafeRawPointer ) {
84
+ _rawValue = other. _rawValue
85
+ }
86
+
87
+ /// Convert an UnsafeRawPointer to ${a_Self}.
88
+ ///
89
+ /// Returns nil if `other` is nil.
90
+ @_transparent
91
+ public init ? ( mutating other: UnsafeRawPointer ? ) {
92
+ guard let unwrapped = other else { return nil }
93
+ _rawValue = unwrapped. _rawValue
94
+ }
95
+ % else : # !mutable
96
+ /// Convert an UnsafeMutableRawPointer to ${a_Self}.
82
97
@_transparent
83
98
public init ( _ other: UnsafeMutableRawPointer ) {
84
99
_rawValue = other. _rawValue
85
100
}
86
101
87
- /// Convert an UnsafeMutableRawPointer ${a_Self}.
102
+ /// Convert an UnsafeMutableRawPointer to ${a_Self}.
88
103
///
89
104
/// Returns nil if `other` is nil.
90
105
@_transparent
@@ -93,13 +108,13 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
93
108
_rawValue = unwrapped. _rawValue
94
109
}
95
110
96
- /// Convert an UnsafeMutablePointer ${a_Self}.
111
+ /// Convert an UnsafeMutablePointer to ${a_Self}.
97
112
@_transparent
98
113
public init < T> ( _ other: UnsafeMutablePointer < T > ) {
99
114
_rawValue = other. _rawValue
100
115
}
101
116
102
- /// Convert an UnsafeMutablePointer ${a_Self}.
117
+ /// Convert an UnsafeMutablePointer to ${a_Self}.
103
118
///
104
119
/// Returns nil if `other` is nil.
105
120
@_transparent
0 commit comments