index(_:offsetBy:)
func index(_ i: AnyCollection<Element>.Index, offsetBy n: Int) -> AnyCollection<Element>.Index func index(_ i: AnyCollection<Element>.Index, offsetBy n: Int) -> AnyCollection<Element>.Index import Swift@frozen struct AnyCollection<Element>A type-erased wrapper over any collection with indices that support forward traversal.
typealias Index = AnyIndex@frozen struct IntA signed integer value type.
init(_ other: AnyCollection<Element>) Creates an AnyCollection having the same underlying collection as other.
init<C>(_ base: C) where Element == C.Element, C : BidirectionalCollection Creates a type-erased collection that wraps the given collection.
init<C>(_ base: C) where Element == C.Element, C : RandomAccessCollection Creates a type-erased collection that wraps the given collection.
init<C>(_ base: C) where Element == C.Element, C : Collection Creates a type-erased collection that wraps the given collection.
init(_ other: AnyRandomAccessCollection<Element>) Creates an AnyCollection having the same underlying collection as other.
init(_ other: AnyBidirectionalCollection<Element>) Creates an AnyCollection having the same underlying collection as other.
var count: Int { get }The number of elements.
var endIndex: AnyCollection<Element>.Index { get }The collection’s “past the end” position—that is, the position one greater than the last valid subscript argument.
var startIndex: AnyCollection<Element>.Index { get }The position of the first element in a non-empty collection.
var underestimatedCount: Int { get }subscript(bounds: Range<AnyCollection<Element>.Index>) -> AnyCollection<Element>.SubSequence { get } subscript(position: AnyCollection<Element>.Index) -> Element { get } Accesses the element indicated by position.
func distance(from start: AnyCollection<Element>.Index, to end: AnyCollection<Element>.Index) -> Int func drop(while predicate: (Element) throws -> Bool) rethrows -> AnyCollection<Element> func dropFirst(_ n: Int = 1) -> AnyCollection<Element> func dropLast(_ n: Int = 1) -> AnyCollection<Element> func filter(_ isIncluded: (Element) throws -> Bool) rethrows -> [Element] func forEach(_ body: (Element) throws -> Void) rethrows func formIndex(_ i: inout AnyCollection<Element>.Index, offsetBy n: Int) func formIndex(_ i: inout AnyCollection<Element>.Index, offsetBy n: Int, limitedBy limit: AnyCollection<Element>.Index) -> Bool func formIndex(after i: inout AnyCollection<Element>.Index) func index(_ i: AnyCollection<Element>.Index, offsetBy n: Int, limitedBy limit: AnyCollection<Element>.Index) -> AnyCollection<Element>.Index? func index(after i: AnyCollection<Element>.Index) -> AnyCollection<Element>.Index func makeIterator() -> AnyCollection<Element>.Iterator Returns an iterator over the elements of this collection.
func map<T, E>(_ transform: (Element) throws(E) -> T) throws(E) -> [T] where E : Error func prefix(_ maxLength: Int = 1) -> AnyCollection<Element> func prefix(while predicate: (Element) throws -> Bool) rethrows -> AnyCollection<Element> func suffix(_ maxLength: Int) -> AnyCollection<Element> typealias Indices = DefaultIndices<AnyCollection<Element>>typealias Iterator = AnyIterator<Element>typealias SubSequence = AnyCollection<Element>