RangeReplaceableCollection

extension RangeReplaceableCollection
  • Creates a collection containing the elements of a cursor.

    // [String]
    let strings = try Array(cursor)
    

    Declaration

    Swift

    @inlinable
    public init<C>(_ cursor: C) throws where C : Cursor, Self.Element == C.Element

    Parameters

    cursor

    The cursor whose elements feed the collection.

  • Creates a collection containing the elements of a cursor.

    // [String]
    let strings = try Array(cursor, minimumCapacity: 100)
    

    Declaration

    Swift

    @inlinable
    public init<C>(_ cursor: C, minimumCapacity: Int) throws where C : Cursor, Self.Element == C.Element

    Parameters

    cursor

    The cursor whose elements feed the collection.

    minimumCapacity

    Prepares the returned collection to store the specified number of elements.