[swift-evolution] SE-0138 UnsafeRawBufferPointer

Jeremy Pereira jeremy.j.pereira at googlemail.com
Tue Sep 27 03:17:51 CDT 2016


> 
> Annotating that a parameter of a closure should not escape the closure is probably a worthwhile thing to have, anyway. Currently we only allow that for function-type parameters, but there are other parameters you might give (such as the pointer in `String.withCString()`’s closure) which should not escape their context.


It certainly needs to be at least explicitly documented somewhere. I’ve seen people use it in published code to obtain a pointer to (fro example) the bytes in an array without realising that the storage could easily go away.


> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list