Replaces this pointer’s memory with the specified number of consecutive copies of the given value.
SDK
- Xcode 9.3+
Framework
- Swift Standard Library
Declaration
func assign(repeating repeatedValue: Pointee, count: Int)
Parameters
repeatedValue
The instance to assign this pointer’s memory to.
count
The number of consecutive copies of
new
to assign.Value count
must not be negative.
Discussion
The region of memory starting at this pointer and covering count
instances of the pointer’s Pointee
type must be initialized or Pointee
must be a trivial type. After calling assign(repeating:
, the region is initialized.