std::atomic_ref<T>:: required_alignment
From cppreference.net
<
cpp
|
atomic
|
atomic ref
C++
Concurrency support library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::atomic_ref
| Member functions | ||||
|
(C++26)
|
||||
|
Operations for arithmetic types
(except
bool
and pointer-to-object)
|
||||
|
Operations for integral types
(except
bool
and pointer-to-object)
|
||||
|
(C++26)
|
||||
|
(C++26)
|
||||
|
Operations for integral types
(except
bool
)
|
||||
| Constants | ||||
|
atomic_ref::required_alignment
|
|
static
constexpr
std::
size_t
required_alignment
=
/*implementation-defined*/
;
|
(C++20 起) | |
required_alignment
的值是原子引用所引用对象所需的对齐要求,该值至少为
alignof
(
T
)
。
注释
硬件可能要求被
atomic_ref<T>
引用的对象比其他
T
对象具有更严格的对齐要求,并且对
atomic_ref
的操作是否无锁可能取决于被引用对象的对齐方式。