A nonowning collection interface to a buffer of elements stored contiguously in memory.
- Xcode 6.0.1+
- Swift Standard Library
You can use an
Unsafe instance in low level operations to eliminate uniqueness checks and, in release mode, bounds checks. Bounds checks are always performed in debug mode.
Unsafe instance is a view into memory and does not own the memory that it references. Copying a value of type
Unsafe does not copy the instances stored in the underlying memory. However, initializing another collection with an
Unsafe instance copies the instances out of the referenced memory and into the new collection.