Contents

init(mutating:)

Mutate untyped memory as a typed span.

Declaration

init(mutating mutableBytes: inout MutableRawSpan)

Parameters

  • mutableBytes:

    A raw span to reinterpret as typed elements.

Discussion

The byteCount of mutableBytes must be a multiple of Element’s stride, and the starting address of mutableBytes must be well-aligned for the type of Element. If either of these requirements is not met, this initializer will trap at runtime.