description
TypeScriptget description(): stringSwift declarationvar description: String { get }A string that represents the contents of the word pair.
struct · iOS 18.0+ · SDK 27.1
@frozen struct WordPairA pair of two word sized `UInt`s. 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.
get description(): stringSwift declarationvar description: String { get }A string that represents the contents of the word pair.
get debugDescription(): stringSwift declarationvar debugDescription: String { get }A string that represents the contents of the word pair, suitable for debugging.
static decodeAtomicRepresentation(representation: WordPair_AtomicRepresentation): WordPairSwift declarationstatic func decodeAtomicRepresentation(_ representation: consuming WordPair.AtomicRepresentation) -> WordPairRecovers the logical atomic type `Self` by destroying some `AtomicRepresentation` storage instance returned from an atomic operation. - Note: This is not an atomic operation. This simply decodes the storage representation used in atomic operations back into the logical type for normal use, `Self`. - Parameter representation: The storage representation for `Self` that's used within atomic operations. - Returns: The newly decoded logical type `Self`.
static encodeAtomicRepresentation(value: WordPair): WordPair_AtomicRepresentationSwift declarationstatic func encodeAtomicRepresentation(_ value: consuming WordPair) -> WordPair.AtomicRepresentationDestroys a value of `Self` and prepares an `AtomicRepresentation` storage type to be used for atomic operations. - Note: This is not an atomic operation. This simply encodes the logical type `Self` into its storage representation suitable for atomic operations, `AtomicRepresentation`. - Parameter value: A valid instance of `Self` that's about to be destroyed to encode an instance of its `AtomicRepresentation`. - Returns: The newly encoded `AtomicRepresentation` storage.
static init(first: number, second: number): WordPairSwift declarationinit(first: UInt, second: UInt)Initialize a new `WordPair` value given both individual words. - Parameter first: The first word to use in the pair. - Parameter second: The second word to use in the pair.
get first(): numberSwift declarationvar first: UIntThe first element in this word pair.
set first(value: number)Swift declarationvar first: UIntThe first element in this word pair.
get second(): numberSwift declarationvar second: UIntThe second element in this word pair.
set second(value: number)Swift declarationvar second: UIntThe second element in this word pair.
No declarations were skipped in this snapshot.