std::atomic_ref<T>::required_alignment

From cppreference.com
< cpp‎ | atomic‎ | atomic ref
 
 
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
(C++11)
Generic lock management
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
(C++11)
Safe Reclamation
(C++26)
Hazard Pointers
Atomic types
(C++11)
(C++20)
Initialization of atomic types
(C++11)(deprecated in C++20)
(C++11)(deprecated in C++20)
Memory ordering
Free functions for atomic operations
Free functions for atomic flags
 
 
static constexpr std::size_t required_alignment = /*implementation-defined*/;
(since C++20)

The value of required_alignment is the required alignment for an object to be referenced by an atomic reference, which is at least alignof(T).

Notes

Hardware could require that an object to be referenced by an atomic_ref<T> have stricter alignment than other T objects, and whether operations on an atomic_ref are lock-free can depend on the alignment of the referenced object.