[stdlib] conversions to String.UTF8Index

Swift SVN r24011
This commit is contained in:
Dave Abrahams
2014-12-18 20:47:35 +00:00
parent 27983cf144
commit 3c9c3fa457
6 changed files with 141 additions and 1 deletions

View File

@@ -877,6 +877,14 @@ extension UTF16 {
) + 0xDC00
}
public static func isLeadSurrogate(x: CodeUnit) -> Bool {
return 0xD800...0xDBFF ~= x
}
public static func isTrailSurrogate(x: CodeUnit) -> Bool {
return 0xDC00...0xDFFF ~= x
}
public // @testable
static func _copy<T : _StringElementType, U : _StringElementType>(
source: UnsafeMutablePointer<T>,