---
title: "initialize(from:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/unsafemutablepointer/initialize(from:)"
---

# initialize(from:)

Initializes memory starting at this pointer’s address with the elements of the given collection.

## Declaration

```swift
func initialize<C>(from source: C) where Pointee == C.Element, C : Collection
```

## Parameters

- `source`: A collection of elements of the pointer’s Pointee type.

## Discussion

Discussion The region of memory starting at this pointer and covering source.count instances of the pointer’s Pointee type must be uninitialized or Pointee must be a trivial type. After calling initialize(from:), the region is initialized.
