<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 8, 2016, at 10:24 AM, Alex Martini via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 7, 2016, at 10:07 PM, Douglas Gregor &lt;<a href="mailto:dgregor@apple.com" class="">dgregor@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">Hello Swift community,</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">The review of SE-0147 "Move UnsafeMutablePointer.initialize(from:) to UnsafeMutableBufferPointer" begins now and runs through December 12, 2016. The proposal is available here:</p><blockquote style="box-sizing: border-box; margin: 0px 0px 16px; padding: 0px 1em; border-left-width: 0.25em; border-left-style: solid; border-left-color: rgb(221, 221, 221); background-color: rgb(255, 255, 255);" class=""><div style="box-sizing: border-box; margin-top: 0px; margin-bottom: 0px;" class=""><font color="#777777" face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3" class=""><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0147-move-unsafe-initialize-from.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0147-move-unsafe-initialize-from.md</a></font></div></blockquote></div></div></blockquote><br class=""></div><div class=""><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; color: rgb(51, 51, 51);" class=""><span style="box-sizing: border-box; color: rgb(167, 29, 93);" class="pl-k">extension</span> <span style="box-sizing: border-box; color: rgb(121, 93, 163);" class="pl-en"><span style="box-sizing: border-box; color: rgb(0, 134, 179);" class="pl-c1">UnsafeMutableBufferPointer</span></span> {
  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">/// Initializes memory in the buffer with the elements of `source`.</span>
<span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"></span>  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">/// Returns an iterator to any elements of `source` that didn't fit in the </span>
<span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"></span>  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">/// buffer, and an index to the point in the buffer one past the last element</span>
<span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"></span>  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">/// written (so `startIndex` if no elements written, `endIndex` if the buffer </span>
<span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"></span>  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">/// was completely filled).</span>
<span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"></span>  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">///</span>
<span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"></span>  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">/// - Precondition: The memory in `self` is uninitialized. The buffer must contain</span>
<span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"></span>  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">///   sufficient uninitialized memory to accommodate `source.underestimatedCount`.</span>
<span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"></span>  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">///</span>
<span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"></span>  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">/// - Postcondition: The returned iterator</span>
<span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"></span>  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">/// - Postcondition: The `Pointee`s at `self[startIndex..&lt;initializedUpTo]` </span>
<span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"></span>  <span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c">///   are initialized.</span>
</pre><div class=""><span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"><br class=""></span></div><div class=""><span style="box-sizing: border-box; color: rgb(150, 152, 150);" class="pl-c"><br class=""></span></div><div class=""><span style="box-sizing: border-box; background-color: white;" class="pl-c"><font color="#333333" face="Helvetica Neue" size="3" class="">It looks like the first postcondition got cut off.</font></span></div></div></div>_______________________________________________<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></blockquote></div><br class=""><div class="">Thanks Alex, sorry about that. This should probably read “The returned iterator will yield any remaining elements of the sequence not written to the buffer”. I’m not sure if this really needs to be a postcondition though, in addition to being the documented behavior of the return value.</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>