---
title: Repeated
framework: swift
role: symbol
role_heading: Structure
path: swift/repeated
---

# Repeated

A collection whose elements are all identical.

## Declaration

```swift
@frozen struct Repeated<Element>
```

## Overview

Overview 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"

## Topics

### Instance Properties

- [count](swift/repeated/count.md)
- [repeatedValue](swift/repeated/repeatedvalue.md)

### Default Implementations

- [BidirectionalCollection Implementations](swift/repeated/bidirectionalcollection-implementations.md)
- [Collection Implementations](swift/repeated/collection-implementations.md)
- [RandomAccessCollection Implementations](swift/repeated/randomaccesscollection-implementations.md)
- [Sequence Implementations](swift/repeated/sequence-implementations.md)

## Relationships

### Conforms To

- [BidirectionalCollection](swift/bidirectionalcollection.md)
- [Collection](swift/collection.md)
- [Copyable](swift/copyable.md)
- [DataProtocol](foundation/dataprotocol.md)
- [Escapable](swift/escapable.md)
- [RandomAccessCollection](swift/randomaccesscollection.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [Sequence](swift/sequence.md)

## See Also

### Wrappers for Algorithms

- [CollectionDifference](swift/collectiondifference.md)
- [DropFirstSequence](swift/dropfirstsequence.md)
- [DropWhileSequence](swift/dropwhilesequence.md)
- [EnumeratedSequence](swift/enumeratedsequence.md)
- [FlattenCollection](swift/flattencollection.md)
- [FlattenSequence](swift/flattensequence.md)
- [JoinedSequence](swift/joinedsequence.md)
- [PrefixSequence](swift/prefixsequence.md)
- [ReversedCollection](swift/reversedcollection.md)
- [StrideTo](swift/strideto.md)
- [StrideThrough](swift/stridethrough.md)
- [UnfoldSequence](swift/unfoldsequence.md)
- [Zip2Sequence](swift/zip2sequence.md)
