Repeated

A collection whose elements are all identical.

@frozen struct Repeated<Element>

You create an instance of the Repeated collection by calling the repeatElement(_:count:) function. The following example creates a collection containing the name “Humperdinck” repeated five times:

let repeatedName = repeatElement("Humperdinck", count: 5)
for name in repeatedName {
    print(name)
}
// "Humperdinck"
// "Humperdinck"
// "Humperdinck"
// "Humperdinck"
// "Humperdinck"