Binds the memory to the specified type and returns a typed pointer to the bound memory.
- Xcode 8.0+
- Swift Standard Library
Tto bind the memory to.
The amount of memory to bind to type
T, counted as instances of
A typed pointer to the newly bound memory. The memory in this region is bound to
T, but has not been modified in any other way. The number of bytes in this region is
count * Memory.
bind method to bind the memory referenced by this pointer to the type
T. The memory must be uninitialized or initialized to a type that is layout compatible with
T. If the memory is uninitialized, it is still uninitialized after being bound to
In this example, 100 bytes of raw memory are allocated for the pointer
bytes, and then the first four bytes are bound to the
bind, the first four bytes of the memory referenced by
bytes are bound to the
Int8 type, though they remain uninitialized. The remainder of the allocated region is unbound raw memory. All 100 bytes of memory must eventually be deallocated.