---
title: "extracting(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/unsafemutablebufferpointer/extracting(_:)-6xfww"
---

# extracting(_:)

Extracts and returns a copy of the entire buffer.

## Declaration

```swift
func extracting(_ bounds: UnboundedRange) -> UnsafeMutableBufferPointer<Element>
```

## Return Value

Return Value The same buffer as self.

## Discussion

Discussion When Element is copyable, the extracting operation is equivalent to slicing the buffer then rebasing the resulting buffer slice: let a = buffer let b = buffer.extracting(...) let c = UnsafeBufferPointer(rebasing: buffer[...]) // `a`, `b` and `c` are now all referring to the same buffer Note that unlike slicing, the extracting operation remains available even if Element happens to be noncopyable.
