---
title: "withUnsafeBufferPointer(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/mutablespan/withunsafebufferpointer(_:)"
---

# withUnsafeBufferPointer(_:)

## Declaration

```swift
func withUnsafeBufferPointer<E, Result>(_ body: (UnsafeBufferPointer<Element>) throws(E) -> Result) throws(E) -> Result where E : Error, Result : ~Copyable
```
