6 #ifndef EASTL_ATOMIC_INTERNAL_STATIC_ASSERTS_H
7 #define EASTL_ATOMIC_INTERNAL_STATIC_ASSERTS_H
9 #if defined(EA_PRAGMA_ONCE_SUPPORTED)
14 #define EASTL_ATOMIC_STATIC_ASSERT_VOLATILE_MEM_FN(type) \
15 static_assert(!eastl::is_same<type, type>::value, "eastl::atomic<T> : volatile eastl::atomic<T> is not what you expect! Read the docs in EASTL/atomic.h! Use the memory orders to access the atomic object!");
17 #define EASTL_ATOMIC_STATIC_ASSERT_INVALID_MEMORY_ORDER(type) \
18 static_assert(!eastl::is_same<type, type>::value, "eastl::atomic<T> : invalid memory order for the given operation!");
20 #define EASTL_ATOMIC_STATIC_ASSERT_TYPE(type) \
22 static_assert(!eastl::is_const<type>::value, "eastl::atomic<T> : Template Typename T cannot be const!"); \
23 static_assert(!eastl::is_volatile<type>::value, "eastl::atomic<T> : Template Typename T cannot be volatile! Use the memory orders to access the underlying type for the guarantees you need."); \
25 static_assert(eastl::is_standard_layout<type>::value, "eastl::atomic<T> : Must have standard layout!"); \
27 static_assert(eastl::is_trivially_copyable<type>::value, "eastl::atomci<T> : Template Typename T must be trivially copyable!"); \
28 static_assert(eastl::is_copy_constructible<type>::value, "eastl::atomic<T> : Template Typename T must be copy constructible!"); \
29 static_assert(eastl::is_move_constructible<type>::value, "eastl::atomic<T> : Template Typename T must be move constructible!"); \
30 static_assert(eastl::is_copy_assignable<type>::value, "eastl::atomic<T> : Template Typename T must be copy assignable!"); \
31 static_assert(eastl::is_move_assignable<type>::value, "eastl::atomic<T> : Template Typename T must be move assignable!"); \
32 static_assert(eastl::is_trivially_destructible<type>::value, "eastl::atomic<T> : Must be trivially destructible!"); \
33 static_assert(eastl::internal::is_atomic_lockfree_size<type>::value, "eastl::atomic<T> : Template Typename T must be a lockfree size!");
35 #define EASTL_ATOMIC_STATIC_ASSERT_TYPE_IS_OBJECT(type) \
36 static_assert(eastl::is_object<type>::value, "eastl::atomic<T> : Template Typename T must be an object type!");
38 #define EASTL_ATOMIC_ASSERT_ALIGNED(alignment) \
39 EASTL_ASSERT((alignment & (alignment - 1)) == 0); \
40 EASTL_ASSERT((reinterpret_cast<uintptr_t>(this) & (alignment - 1)) == 0)
EA Standard Template Library.
Definition: algorithm.h:288
Definition: atomic_asserts.h:53
Definition: type_traits.h:604