UnsafeBufferPointer
A nonowning collection interface to a buffer of elements stored contiguously in memory.
Declaration
@frozen struct UnsafeBufferPointer<Element> where Element : ~CopyableOverview
You can use an UnsafeBufferPointer instance in low level operations to eliminate uniqueness checks and, in release mode, bounds checks. Bounds checks are always performed in debug mode.
UnsafeBufferPointer Semantics
An UnsafeBufferPointer instance is a view into memory and does not own the memory that it references. Copying a value of type UnsafeBufferPointer does not copy the instances stored in the underlying memory. However, initializing another collection with an UnsafeBufferPointer instance copies the instances out of the referenced memory and into the new collection.