Contents

withUnsafeMutablePointer(_:)

Invokes the provided closure with the backing data and memory layout of this view.

Declaration

@export(implementation) mutating func withUnsafeMutablePointer<R, E>(_ body: (UnsafeMutablePointer<Element>, Span<Int>, Span<Int>) throws(E) -> R) throws(E) -> R where E : Error

Return Value

The value returned by the closure.

Discussion

  • body: The closure to be invoked with a mutable pointer to the first element, as well as shape and strides of the view.