Instance Method

assign(from:count:)

Replaces this pointer’s initialized memory with the specified number of instances from the given pointer’s memory.

Declaration

func assign(from source: UnsafePointer<Pointee>, count: Int)

Parameters

source

A pointer to at least count initialized instances of type Pointee. The memory regions referenced by source and this pointer may overlap.

count

The number of instances to copy from the memory referenced by source to this pointer’s memory. 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(from:count:), the region is initialized.