<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/UnsafeMutablePointer/initialize(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:SpsRi_zrlE10initialize2toyxn_tF"
  },
  "title" : "initialize(to:)"
}
-->

# initialize(to:)

Initializes this pointer’s memory with a single instance of the given
value.

```
func initialize(to value: consuming Pointee)
```

## Parameters

`value`

The instance to initialize this pointer’s pointee to.

## Discussion

The destination memory must be uninitialized or the pointer’s `Pointee`
must be a trivial type. After a call to `initialize(to:)`, the memory
referenced by this pointer is initialized. Calling this method is roughly
equivalent to calling `initialize(repeating:count:)` with a `count` of 1.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)