---
title: "withUnsafeMutablePointers(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/managedbuffer/withunsafemutablepointers(_:)"
---

# withUnsafeMutablePointers(_:)

Call body with UnsafeMutablePointers to the stored Header and raw Element storage.

## Declaration

```swift
final func withUnsafeMutablePointers<E, R>(_ body: (UnsafeMutablePointer<Header>, UnsafeMutablePointer<Element>) throws(E) -> R) throws(E) -> R where E : Error, R : ~Copyable
```

## Discussion

Discussion note: These pointers are valid only for the duration of the call to body. The caller is responsible for ensuring that the buffer is not being accessed elsewhere while performing this call.
