Instance Method

assign(repeating:count:)

Replaces this pointer’s memory with the specified number of consecutive copies of the given value.

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 newValue to assign. 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:count:), the region is initialized.