<div dir="ltr">Thanks to Joe and Quinn for their answers. I have a related followup — a co-worker learning Swift wrote the following function:<br><div><br>    func allZerosUUID() -&gt; String {<br>        var allZeros = [UInt8](repeating: 0, count: 32)<br>        return withUnsafePointer(to: &amp;allZeros) { zerosPtr in<br>            return NSUUID(uuidBytes: zerosPtr).uuidString<br>        }<br>    }<br><br>but was puzzled that Xcode 8.2.1 gave an error &quot;Cannot convert value of type &#39;UnsafePointer&lt;_&gt;&#39; to expected argument type &#39;UnsafePointer&lt;UInt8&gt;!&#39;&quot; on the line with the NSUUID initializer.  Their expectation was that `zerosPtr` would be of type `UnsafePointer&lt;UInt8&gt;` because `allZeros` is of type `[UInt8]`.  </div><div><br></div><div>They discovered that they could work around this by adding a call to `withMemoryRebound`:<br><br>    func allZerosUUID() -&gt; String {<br>        var allZeros = [UInt8](repeating: 0, count: 32)<br>        return withUnsafePointer(to: &amp;allZeros) { zerosPtr in<br>            zerosPtr.withMemoryRebound(to: UInt8.self, capacity: allZeros.count) { zerosPtr in<br>                return NSUUID(uuidBytes: zerosPtr).uuidString<br>            }<br>        }<br>    }<br><br>but felt that this should be unnecessary. Perhaps I&#39;m missing something simple, but I was unable to explain this compiler behavior; can anyone on the list do so?</div><div><br></div><div>(Yes, I did point out that they could pass `&amp;allZeros` directly to `NSUUID(uuidBytes:)`.)<br></div><div class="gmail_extra"><div class="gmail_quote"><br></div><div class="gmail_quote">Thanks — Russell</div><div class="gmail_quote"><br></div></div></div>