<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/ManagedBufferPointer/withUnsafeMutablePointerToHeader(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s20ManagedBufferPointerVsRi__rlE017withUnsafeMutableC8ToHeaderyqd_0_qd_0_SpyxGqd__YKXEqd__YKs5ErrorRd__Ri_d_0_r0_lF"
  },
  "title" : "withUnsafeMutablePointerToHeader(_:)"
}
-->

# withUnsafeMutablePointerToHeader(_:)

Call `body` with an `UnsafeMutablePointer` to the stored
`Header`.

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

## Discussion> Note: This pointer is valid only for the duration of the call to
> `body`. The caller is responsible for ensuring that the buffer is not
> being accessed anyone else while performing this call.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)