<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Looks reasonable to me.<br class=""><div class="">
<br class="Apple-interchange-newline"><span style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;" class="">Félix</span>
</div>
<br class=""><div style=""><blockquote type="cite" class=""><div class="">Le 2 févr. 2016 à 19:50:50, Guillaume Lessard via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class=""><blockquote type="cite" class="">On 2 févr. 2016, at 16:06, Janosch Hildebrand via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">func assignBackwardFrom(source: UnsafeMutablePointer<Pointee>, count: Int)<br class="">func assignFrom(source: UnsafeMutablePointer<Pointee>, count: Int)<br class="">func initializeFrom(source: UnsafeMutablePointer<Pointee>, count: Int)<br class=""><br class="">Basically my proposal boils down to adding overloads for these methods to `UnsafeMutablePointer` that take `UnsafePointer` source arguments instead.<br class=""></blockquote><br class="">I agree with these; I have run into this situation as well.<br class=""><br class=""><blockquote type="cite" class=""><br class="">Related:<br class="">I also have a few related items that might make sense to discuss in tandem while we're talking about `UnsafePointer` and friends.<br class=""><br class="">* func distanceTo(x: Unsafe(Mutable)Pointer<Memory>) -> Int<br class="">This is the only other method on `UnsafePointer` and `UnsafeMutablePointer` for which similar overloads might make sense. However, I cannot really see enough of a use case to justify adding overloads here. Also the current methods match protocol requirements whereas the overloads would not.<br class=""></blockquote><br class="">I don’t think this would makes sense. This method exists to support indexing within a single block of memory; overloading across types might encourage recklessness.<br class=""><br class="">This being said, I’ve come to think the indexing operations should only exist on the Buffer wrappers to the UnsafePointer family.<br class=""><br class="">Guillaume Lessard<br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></div></blockquote></div><br class=""></body></html>