Contents

initialize(repeating:)

Initializes every element in this buffer slice’s memory to a copy of the given value.

Declaration

func initialize<Element>(repeating repeatedValue: Element) where Base == UnsafeMutableBufferPointer<Element>

Parameters

  • repeatedValue:

    The value with which to initialize this buffer slice’s memory.

Discussion

The destination memory must be uninitialized or the buffer’s Element must be a trivial type. After a call to initialize(repeating:), the entire region of memory referenced by this buffer slice is initialized.