> On Dec 8, 2016, at 10:24 AM, Alex Martini via swift-evolution > <[email protected]> wrote: > > >> On Dec 7, 2016, at 10:07 PM, Douglas Gregor <[email protected] >> <mailto:[email protected]>> wrote: >> >> Hello Swift community, >> >> The review of SE-0147 "Move UnsafeMutablePointer.initialize(from:) to >> UnsafeMutableBufferPointer" begins now and runs through December 12, 2016. >> The proposal is available here: >> >> https://github.com/apple/swift-evolution/blob/master/proposals/0147-move-unsafe-initialize-from.md >> >> <https://github.com/apple/swift-evolution/blob/master/proposals/0147-move-unsafe-initialize-from.md> > extension UnsafeMutableBufferPointer { > /// Initializes memory in the buffer with the elements of `source`. > /// Returns an iterator to any elements of `source` that didn't fit in the > /// buffer, and an index to the point in the buffer one past the last > element > /// written (so `startIndex` if no elements written, `endIndex` if the > buffer > /// was completely filled). > /// > /// - Precondition: The memory in `self` is uninitialized. The buffer must > contain > /// sufficient uninitialized memory to accommodate > `source.underestimatedCount`. > /// > /// - Postcondition: The returned iterator > /// - Postcondition: The `Pointee`s at `self[startIndex..<initializedUpTo]` > /// are initialized. > > > It looks like the first postcondition got cut off. > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution
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.
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
