<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/RawRepresentable/decodeAtomicOptionalRepresentation(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:SY15SynchronizationAA27AtomicOptionalRepresentableRzAaB8RawValueSYRpzrlE06decodebC14RepresentationyxSgACSY_0bcH0QZnFZ"
  },
  "title" : "decodeAtomicOptionalRepresentation(_:)"
}
-->

# decodeAtomicOptionalRepresentation(_:)

Recovers the logical atomic type `Self?` by destroying some
`AtomicOptionalRepresentation` storage instance returned from an atomic
operation on `Optional`.

```
static func decodeAtomicOptionalRepresentation(_ representation: consuming Self.RawValue.AtomicOptionalRepresentation) -> Self?
```

## Parameters

`representation`

The optional storage representation for `Self?`
that’s used within atomic operations on `Optional`.

## Return Value

The newly decoded logical type `Self?`.

## Discussion> Note: This is not an atomic operation. This simply decodes the storage
> representation used in atomic operations on `Optional` back into the
> logical type for normal use, `Self?`.

---

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)