assumingMemoryBound(to:)
Returns a typed pointer to the memory referenced by this pointer, assuming that the memory is already bound to the specified type.
Declaration
func assumingMemoryBound<T>(to: T.Type) -> UnsafePointer<T> where T : ~CopyableParameters
- to:
The type
Tthat the memory has already been bound to.
Return Value
A typed pointer to the same memory as this raw pointer.
Discussion
Use this method when you have a raw pointer 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.