Skip to main content

function

move_from_pointee

move_from_pointee[T: Movable](ptr: UnsafePointer[T, address_space]) -> $0

Move the value at the pointer out.

The pointer must not be null, and the pointer memory location is assumed to contain a valid initialized instance of T.

This performs a consuming move, ending the lifetime of the value stored in this pointer memory location. Subsequent reads of this pointer are not valid. If a new valid value is stored using initialize_pointee_move(), then reading from this pointer becomes valid again.

Parameters:

  • T (Movable): The type the pointer points to, which must be Movable.

Args:

  • ptr (UnsafePointer[T, address_space]): The pointer whose pointee this moves from.

Returns:

The value at the pointer.