initializeElement(at:to:)
Initializes the element at index to the given value.
Declaration
func initializeElement(at index: UnsafeMutableBufferPointer<Element>.Index, to value: consuming Element)Parameters
- index:
The index of the element to initialize
- value:
The value used to initialize the buffer element’s memory.
Discussion
The memory underlying the destination element must be uninitialized, or Element must be a trivial type. After a call to initialize(to:), the memory underlying this element of the buffer is initialized.