---
title: "encodeAtomicOptionalRepresentation(_:)"
framework: synchronization
role: symbol
role_heading: Type Method
path: "synchronization/atomicoptionalrepresentable/encodeatomicoptionalrepresentation(_:)"
---

# encodeAtomicOptionalRepresentation(_:)

Destroys a value of Self and prepares an AtomicOptionalRepresentation storage type to be used for atomic operations on Optional.

## Declaration

```swift
static func encodeAtomicOptionalRepresentation(_ value: consuming Self?) -> Self.AtomicOptionalRepresentation
```

## Parameters

- `value`: An optional instance of Self that’s about to be destroyed to encode an instance of its AtomicOptionalRepresentation.

## Return Value

Return Value The newly encoded AtomicOptionalRepresentation storage.

## Discussion

Discussion note: This is not an atomic operation. This simply encodes the logical type Self into its storage representation suitable for atomic operations, AtomicOptionalRepresentation.
