[#BloombergLP-bsls-AtomicOperations_DefaultPointer64-061-swapPtr] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/AtomicOperations_DefaultPointer64-061.adoc[AtomicOperations_DefaultPointer64]::swapPtr :relfileprefix: ../../../ :mrdocs: Atomically swap `atomicPtr` and return its previous value. == Synopsis Declared in `<bsls_atomicoperations_default.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void* swapPtr( AtomicTypes::Pointer* atomicPtr, void* swapValue); ---- == Description Atomically set the value of the specified `atomicPtr` to the specified `swapValue`, and return its previous value, providing the sequential consistency memory ordering guarantee. == Return Value previous value of `atomicPtr` == Parameters [cols="1,4"] |=== | Name| Description | *atomicPtr* | atomic pointer to modify | *swapValue* | value to store |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#