Generic Initializer

init(_:)

Creates a new instance of a collection containing the elements of a sequence.

Required. Default implementation provided.

Declaration

init<S>(_ elements: S) where S : Sequence, Self.Element == S.Element

Parameters

elements

The sequence of elements for the new collection. elements must be finite.

Default Implementations

RangeReplaceableCollection Implementations

init<S>(S)

Creates a new instance of a collection containing the elements of a sequence.