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

# withUnsafeBufferPointer(_:)

Calls a closure with a pointer to the object’s contiguous storage.

## Declaration

```swift
func withUnsafeBufferPointer<R>(_ body: (UnsafeBufferPointer<Self.Element>) throws -> R) rethrows -> R
```

## Parameters

- `body`: A closure that receives an doc://com.apple.documentation/documentation/Swift/UnsafeBufferPointer to the sequence’s contiguous storage.
