<!--
{
  "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/Int8/encodeAtomicRepresentation(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s4Int8V15SynchronizationE26encodeAtomicRepresentationyAC18_Atomic8BitStorageVABFZ"
  },
  "title" : "encodeAtomicRepresentation(_:)"
}
-->

# encodeAtomicRepresentation(_:)

Destroys a value of `Self` and prepares an `AtomicRepresentation` storage
type to be used for atomic operations.

```
static func encodeAtomicRepresentation(_ value: borrowing Int8) -> Int8.AtomicRepresentation
```

## Parameters

`value`

A valid instance of `Self` that’s about to be destroyed
to encode an instance of its `AtomicRepresentation`.

## Return Value

The newly encoded `AtomicRepresentation` storage.

## Discussion> Note: This is not an atomic operation. This simply encodes the logical
> type `Self` into its storage representation suitable for atomic
> operations, `AtomicRepresentation`.

---

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)