---
title: WordPair
framework: synchronization
role: symbol
role_heading: Structure
path: synchronization/wordpair
---

# WordPair

A pair of two word sized UInts.

## Declaration

```swift
@frozen struct WordPair
```

## Overview

Overview This type’s primary purpose is to be used in double wide atomic operations. On platforms that support it, atomic operations on WordPair are done in a single operation for two words. Users can use this type as itself when used on Atomic, or it could be used as an intermediate step for custom AtomicRepresentable types that are also double wide. let atomicPair = Atomic<WordPair>(WordPair(first: 0, second: 0)) atomicPair.store(WordPair(first: someVersion, second: .max), ordering: .relaxed) When used as an intermediate step for custom AtomicRepresentable types, it is critical that their AtomicRepresentation be equal to WordPair.AtomicRepresentation. struct GridPoint {   var x: Int   var y: Int }

extension GridPoint: AtomicRepresentable {   typealias AtomicRepresentation = WordPair.AtomicRepresentation

... } note: This type only conforms to AtomicRepresentable on platforms that support double wide atomics.

## Topics

### Initializers

- [init(first:second:)](synchronization/wordpair/init(first:second:).md)

### Instance Properties

- [first](synchronization/wordpair/first.md)
- [second](synchronization/wordpair/second.md)

### Default Implementations

- [AtomicRepresentable Implementations](synchronization/wordpair/atomicrepresentable-implementations.md)
- [CustomDebugStringConvertible Implementations](synchronization/wordpair/customdebugstringconvertible-implementations.md)
- [CustomStringConvertible Implementations](synchronization/wordpair/customstringconvertible-implementations.md)
- [Equatable Implementations](synchronization/wordpair/equatable-implementations.md)
- [Hashable Implementations](synchronization/wordpair/hashable-implementations.md)

## Relationships

### Conforms To

- [AtomicRepresentable](synchronization/atomicrepresentable.md)
- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Comparable](swift/comparable.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Atomic Values

- [Atomic](synchronization/atomic.md)
- [AtomicLazyReference](synchronization/atomiclazyreference.md)
- [AtomicRepresentable](synchronization/atomicrepresentable.md)
- [AtomicOptionalRepresentable](synchronization/atomicoptionalrepresentable.md)
