initializeElement(at:to:)
Initializes the element at index to the given value.
Declaration
func initializeElement<Element>(at index: Int, to value: Element) where Base == UnsafeMutableBufferPointer<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 slice is initialized.