---
title: "assumingMemoryBound(to:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/unsafemutablerawbufferpointer/assumingmemorybound(to:)"
---

# assumingMemoryBound(to:)

Returns a typed buffer to the memory referenced by this buffer, assuming that the memory is already bound to the specified type.

## Declaration

```swift
func assumingMemoryBound<T>(to: T.Type) -> UnsafeMutableBufferPointer<T> where T : ~Copyable
```

## Parameters

- `to`: The type T that the memory has already been bound to.

## Return Value

Return Value A typed pointer to the same memory as this raw pointer.

## Discussion

Discussion Use this method when you have a raw buffer to memory that has already been bound to the specified type. The memory starting at this pointer must be bound to the type T. Accessing memory through the returned pointer is undefined if the memory has not been bound to T. To bind memory to T, use bindMemory(to:capacity:) instead of this method. note: The buffer’s base address must match the alignment of T (as reported by MemoryLayout<T>.alignment). That is, Int(bitPattern: self.baseAddress) % MemoryLayout<T>.alignment must equal zero.
