init(mutating:)
Creates a mutable typed pointer referencing the same memory as the given immutable pointer.
init(mutating other: UnsafePointer<Pointee>) Parameters
- other
The immutable pointer to convert.
Creates a mutable typed pointer referencing the same memory as the given immutable pointer.
init(mutating other: UnsafePointer<Pointee>) The immutable pointer to convert.
import Swift@frozen struct UnsafeMutablePointer<Pointee> where Pointee : ~CopyableA pointer for accessing and manipulating data of a specific type.
@frozen struct UnsafePointer<Pointee> where Pointee : ~CopyableA pointer for accessing data of a specific type.
init(_ other: UnsafeMutablePointer<Pointee>) Creates a mutable typed pointer referencing the same memory as the given mutable pointer.
init?(_ other: UnsafeMutablePointer<Pointee>?) Creates a mutable typed pointer referencing the same memory as the given mutable pointer.
init?(mutating other: UnsafePointer<Pointee>?) Creates a mutable typed pointer referencing the same memory as the given immutable pointer.
static func allocate(capacity count: Int) -> UnsafeMutablePointer<Pointee> Allocates uninitialized memory for the specified number of instances of type Pointee.
var hashValue: Int { get }var pointee: Pointee { get nonmutating set }Reads or updates the instance referenced by this pointer.
subscript(i: Int) -> Pointee { get nonmutating set } Reads or updates the pointee at the specified offset from this pointer.
func deallocate() Deallocates the memory block previously allocated at this pointer.
@discardableResult func deinitialize(count: Int) -> UnsafeMutableRawPointer Deinitializes the specified number of values starting at this pointer.
func initialize(from source: UnsafePointer<Pointee>, count: Int) Initializes the memory referenced by this pointer with the values starting at the given pointer.
func initialize(repeating repeatedValue: Pointee, count: Int) Initializes this pointer’s memory with the specified number of consecutive copies of the given value.
func initialize(to value: consuming Pointee) Initializes this pointer’s memory with a single instance of the given value.
func move() -> Pointee Retrieves and returns the referenced instance, returning the pointer’s memory to an uninitialized state.
func moveInitialize(from source: UnsafeMutablePointer<Pointee>, count: Int) Moves instances from initialized source memory into the uninitialized memory referenced by this pointer, leaving the source memory uninitialized and the memory referenced by this pointer initialized.
func moveUpdate(from source: UnsafeMutablePointer<Pointee>, count: Int) Update this pointer’s initialized memory by moving the specified number of instances the source pointer’s memory, leaving the source memory uninitialized.
func pointer<Property>(to property: KeyPath<Pointee, Property>) -> UnsafePointer<Property>? Obtain a pointer to the stored property referred to by a key path.
func pointer<Property>(to property: WritableKeyPath<Pointee, Property>) -> UnsafeMutablePointer<Property>? Obtain a mutable pointer to the stored property referred to by a key path.
func update(from source: UnsafePointer<Pointee>, count: Int) Update this pointer’s initialized memory with the specified number of instances, copied from the given pointer’s memory.
func update(repeating repeatedValue: Pointee, count: Int) Update this pointer’s initialized memory with the specified number of consecutive copies of the given value.
func withMemoryRebound<T, E, Result>(to type: T.Type, capacity count: Int, _ body: (UnsafeMutablePointer<T>) throws(E) -> Result) throws(E) -> Result where E : Error, T : ~Copyable, Result : ~Copyable Executes the given closure while temporarily binding memory to the specified number of instances of the given type.
typealias Distance = IntA type that represents the distance between two pointers.
var customPlaygroundQuickLook: PlaygroundQuickLook { get }func assign(from source: UnsafePointer<Pointee>, count: Int) func assign(repeating repeatedValue: Pointee, count: Int) func deallocate(capacity _: Int) @discardableResult func deinitialize() -> UnsafeMutableRawPointer func initialize<C>(from source: C) where Pointee == C.Element, C : Collection Initializes memory starting at this pointer’s address with the elements of the given collection.
func initialize(to newValue: Pointee, count: Int = 1) func moveAssign(from source: UnsafeMutablePointer<Pointee>, count: Int)