---
title: "moveElement(from:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/slice/moveelement(from:)"
---

# moveElement(from:)

Retrieves and returns the element at index, leaving that element’s underlying memory uninitialized.

## Declaration

```swift
func moveElement<Element>(from index: Slice<Base>.Index) -> Element where Base == UnsafeMutableBufferPointer<Element>
```

## Parameters

- `index`: The index of the buffer element to retrieve and deinitialize.

## Return Value

Return Value The instance referenced by this index in this buffer.

## Discussion

Discussion The memory underlying the element at index must be initialized. After calling moveElement(from:), the memory underlying this element of the buffer slice is uninitialized, and still bound to type Element.
