init(viewing:)
View initialized raw memory as a typed span.
Declaration
init(viewing bytes: RawSpan) where Element : ConvertibleFromBytesParameters
- bytes:
An existing
RawSpan, which will define both thisSpan’s lifetime and the memory it represents.
Discussion
The byteCount of bytes must be a multiple of Element’s stride, and the starting address of bytes must be well-aligned for the type of Element. If either of these requirements is not met, this initializer will trap at runtime.