[stdlib] More RandomAccessCollection conformances

I missed a few the first time around.
This commit is contained in:
Dave Abrahams
2016-05-01 18:37:45 -07:00
parent 5fb95180b5
commit 2ea3db0443
5 changed files with 5 additions and 5 deletions

View File

@@ -532,7 +532,7 @@ public func += <
}
}
extension _ContiguousArrayBuffer : Collection {
extension _ContiguousArrayBuffer : RandomAccessCollection {
/// The position of the first element in a non-empty collection.
///
/// In an empty collection, `startIndex == endIndex`.

View File

@@ -753,7 +753,7 @@ public struct DictionaryLiteral<Key, Value> : DictionaryLiteralConvertible {
/// `Collection` conformance that allows `DictionaryLiteral` to
/// interoperate with the rest of the standard library.
extension DictionaryLiteral : Collection {
extension DictionaryLiteral : RandomAccessCollection {
/// The position of the first element in a non-empty `DictionaryLiteral`.
///
/// Identical to `endIndex` in an empty `DictionaryLiteral`.

View File

@@ -12,7 +12,7 @@
/// Buffer type for `ArraySlice<Element>`.
public // @testable
struct _SliceBuffer<Element> : _ArrayBufferProtocol {
struct _SliceBuffer<Element> : _ArrayBufferProtocol, RandomAccessCollection {
internal typealias NativeStorage = _ContiguousArrayStorage<Element>
public typealias NativeBuffer = _ContiguousArrayBuffer<Element>

View File

@@ -571,7 +571,7 @@ public struct _StringCore {
}
}
extension _StringCore : Collection {
extension _StringCore : RandomAccessCollection {
public // @testable
var startIndex: Int {
return 0

View File

@@ -238,7 +238,7 @@ extension UnicodeScalar {
}
}
extension UnicodeScalar.UTF16View : Collection {
extension UnicodeScalar.UTF16View : RandomAccessCollection {
/// The position of the first code unit.
var startIndex: Int {
return 0