Hello Swift Community,
The review of SE-0163 "Improve Interaction Between `private` Declarations and Extensions” ran from April 5th through 11th, 2017. The proposal is accepted with revisions.
Feedback from the community was positive. There was a question during the discussion about how best to construct a String from an array of characters that may or may not be NUL-terminated. Upon reflection, the proposal authors decided that it would best if String provided an initializer that took a collection of code units; feedback on that idea was also positive. The proposal authors also decided that it would be best if strings could be easily converted to a C string with an arbitrary encoding; this was not discussed during the review, but the core team felt that this was obvious enough and sufficiently similar to other API that it did not demand an additional formal review period. Accordingly, this proposal has been accepted with the following two revisions:
1. String will also add the following initializer:
/// Constructs a `String` having the same contents as `codeUnits`.
/// - Parameter codeUnits: a collection of code units in
/// the given `encoding`.
/// - Parameter encoding: describes the encoding in which the code units
/// should be interpreted.
init<C: Collection, Encoding: UnicodeEncoding>(codeUnits: C, encoding: Encoding)
2. String will also add the following method, analogous to the withCString method that has already been proposed:
/// Invokes the given closure on the contents of the string, represented as a
/// pointer to a null-terminated sequence of code units in the given encoding.
func withCString<Result, Encoding: UnicodeEncoding>(encoding: Encoding,
_ body: (UnsafePointer<Encoding.CodeUnit>) throws -> Result) rethrows -> Result