- tmp/tmp4avezvdh/{from.md → to.md} +234 -168
tmp/tmp4avezvdh/{from.md → to.md}
RENAMED
|
@@ -1,288 +1,354 @@
|
|
| 1 |
### Header `<atomic>` synopsis <a id="atomics.syn">[[atomics.syn]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
|
|
|
| 4 |
namespace std {
|
| 5 |
// [atomics.order], order and consistency
|
| 6 |
-
enum class memory_order : unspecified;
|
| 7 |
-
inline constexpr memory_order memory_order_relaxed = memory_order::relaxed;
|
| 8 |
-
inline constexpr memory_order
|
| 9 |
-
inline constexpr memory_order
|
| 10 |
-
inline constexpr memory_order
|
| 11 |
-
inline constexpr memory_order
|
| 12 |
-
inline constexpr memory_order memory_order_seq_cst = memory_order::seq_cst; // freestanding
|
| 13 |
-
|
| 14 |
-
template<class T>
|
| 15 |
-
T kill_dependency(T y) noexcept; // freestanding
|
| 16 |
}
|
| 17 |
|
| 18 |
// [atomics.lockfree], lock-free property
|
| 19 |
-
#define ATOMIC_BOOL_LOCK_FREE unspecified
|
| 20 |
-
#define ATOMIC_CHAR_LOCK_FREE unspecified
|
| 21 |
-
#define ATOMIC_CHAR8_T_LOCK_FREE unspecified
|
| 22 |
-
#define ATOMIC_CHAR16_T_LOCK_FREE unspecified
|
| 23 |
-
#define ATOMIC_CHAR32_T_LOCK_FREE unspecified
|
| 24 |
-
#define ATOMIC_WCHAR_T_LOCK_FREE unspecified
|
| 25 |
-
#define ATOMIC_SHORT_LOCK_FREE unspecified
|
| 26 |
-
#define ATOMIC_INT_LOCK_FREE unspecified
|
| 27 |
-
#define ATOMIC_LONG_LOCK_FREE unspecified
|
| 28 |
-
#define ATOMIC_LLONG_LOCK_FREE unspecified
|
| 29 |
-
#define ATOMIC_POINTER_LOCK_FREE unspecified
|
| 30 |
|
| 31 |
namespace std {
|
| 32 |
// [atomics.ref.generic], class template atomic_ref
|
| 33 |
-
template<class T> struct atomic_ref;
|
| 34 |
-
// [atomics.ref.pointer], partial specialization for pointers
|
| 35 |
-
template<class T> struct atomic_ref<T*>; // freestanding
|
| 36 |
|
| 37 |
// [atomics.types.generic], class template atomic
|
| 38 |
-
template<class T> struct atomic;
|
| 39 |
// [atomics.types.pointer], partial specialization for pointers
|
| 40 |
-
template<class T> struct atomic<T*>;
|
| 41 |
|
| 42 |
// [atomics.nonmembers], non-member functions
|
| 43 |
template<class T>
|
| 44 |
-
bool atomic_is_lock_free(const volatile atomic<T>*) noexcept;
|
| 45 |
template<class T>
|
| 46 |
-
bool atomic_is_lock_free(const atomic<T>*) noexcept;
|
| 47 |
template<class T>
|
| 48 |
-
void atomic_store(volatile atomic<T>*,
|
| 49 |
-
typename atomic<T>::value_type) noexcept;
|
| 50 |
template<class T>
|
| 51 |
-
void atomic_store(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 52 |
template<class T>
|
| 53 |
-
void atomic_store_explicit(volatile atomic<T>*,
|
| 54 |
-
typename atomic<T>::value_type,
|
| 55 |
memory_order) noexcept;
|
| 56 |
template<class T>
|
| 57 |
-
void atomic_store_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 58 |
memory_order) noexcept;
|
| 59 |
template<class T>
|
| 60 |
-
T atomic_load(const volatile atomic<T>*) noexcept;
|
| 61 |
template<class T>
|
| 62 |
-
T atomic_load(const atomic<T>*) noexcept;
|
| 63 |
template<class T>
|
| 64 |
-
T atomic_load_explicit(const volatile atomic<T>*, memory_order) noexcept;
|
| 65 |
template<class T>
|
| 66 |
-
T atomic_load_explicit(const atomic<T>*, memory_order) noexcept;
|
| 67 |
template<class T>
|
| 68 |
-
T atomic_exchange(volatile atomic<T>*,
|
| 69 |
-
typename atomic<T>::value_type) noexcept;
|
| 70 |
template<class T>
|
| 71 |
-
T atomic_exchange(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 72 |
template<class T>
|
| 73 |
-
T atomic_exchange_explicit(volatile atomic<T>*,
|
| 74 |
-
typename atomic<T>::value_type,
|
| 75 |
memory_order) noexcept;
|
| 76 |
template<class T>
|
| 77 |
-
T atomic_exchange_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 78 |
memory_order) noexcept;
|
| 79 |
template<class T>
|
| 80 |
-
bool atomic_compare_exchange_weak(volatile atomic<T>*,
|
| 81 |
typename atomic<T>::value_type*,
|
| 82 |
typename atomic<T>::value_type) noexcept;
|
| 83 |
template<class T>
|
| 84 |
-
bool atomic_compare_exchange_weak(atomic<T>*,
|
| 85 |
typename atomic<T>::value_type*,
|
| 86 |
typename atomic<T>::value_type) noexcept;
|
| 87 |
template<class T>
|
| 88 |
-
bool atomic_compare_exchange_strong(volatile atomic<T>*,
|
| 89 |
typename atomic<T>::value_type*,
|
| 90 |
typename atomic<T>::value_type) noexcept;
|
| 91 |
template<class T>
|
| 92 |
-
bool atomic_compare_exchange_strong(atomic<T>*,
|
| 93 |
typename atomic<T>::value_type*,
|
| 94 |
typename atomic<T>::value_type) noexcept;
|
| 95 |
template<class T>
|
| 96 |
-
bool atomic_compare_exchange_weak_explicit(volatile atomic<T>*,
|
| 97 |
typename atomic<T>::value_type*,
|
| 98 |
typename atomic<T>::value_type,
|
| 99 |
memory_order, memory_order) noexcept;
|
| 100 |
template<class T>
|
| 101 |
-
bool atomic_compare_exchange_weak_explicit(atomic<T>*,
|
| 102 |
typename atomic<T>::value_type*,
|
| 103 |
typename atomic<T>::value_type,
|
| 104 |
memory_order, memory_order) noexcept;
|
| 105 |
template<class T>
|
| 106 |
-
bool atomic_compare_exchange_strong_explicit(volatile atomic<T>*,
|
| 107 |
typename atomic<T>::value_type*,
|
| 108 |
typename atomic<T>::value_type,
|
| 109 |
memory_order, memory_order) noexcept;
|
| 110 |
template<class T>
|
| 111 |
-
bool atomic_compare_exchange_strong_explicit(atomic<T>*,
|
| 112 |
typename atomic<T>::value_type*,
|
| 113 |
typename atomic<T>::value_type,
|
| 114 |
memory_order, memory_order) noexcept;
|
| 115 |
|
| 116 |
template<class T>
|
| 117 |
-
T atomic_fetch_add(volatile atomic<T>*,
|
| 118 |
-
typename atomic<T>::difference_type) noexcept;
|
| 119 |
template<class T>
|
| 120 |
-
T atomic_fetch_add(atomic<T>*, typename atomic<T>::difference_type) noexcept;
|
| 121 |
template<class T>
|
| 122 |
-
T atomic_fetch_add_explicit(volatile atomic<T>*,
|
| 123 |
-
typename atomic<T>::difference_type,
|
| 124 |
memory_order) noexcept;
|
| 125 |
template<class T>
|
| 126 |
-
T atomic_fetch_add_explicit(atomic<T>*, typename atomic<T>::difference_type,
|
| 127 |
memory_order) noexcept;
|
| 128 |
template<class T>
|
| 129 |
-
T atomic_fetch_sub(volatile atomic<T>*,
|
| 130 |
-
typename atomic<T>::difference_type) noexcept;
|
| 131 |
template<class T>
|
| 132 |
-
T atomic_fetch_sub(atomic<T>*, typename atomic<T>::difference_type) noexcept;
|
| 133 |
template<class T>
|
| 134 |
-
T atomic_fetch_sub_explicit(volatile atomic<T>*,
|
| 135 |
-
typename atomic<T>::difference_type,
|
| 136 |
memory_order) noexcept;
|
| 137 |
template<class T>
|
| 138 |
-
T atomic_fetch_sub_explicit(atomic<T>*, typename atomic<T>::difference_type,
|
| 139 |
memory_order) noexcept;
|
| 140 |
template<class T>
|
| 141 |
-
T atomic_fetch_and(volatile atomic<T>*,
|
| 142 |
-
typename atomic<T>::value_type) noexcept;
|
| 143 |
template<class T>
|
| 144 |
-
T atomic_fetch_and(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 145 |
template<class T>
|
| 146 |
-
T atomic_fetch_and_explicit(volatile atomic<T>*,
|
| 147 |
-
typename atomic<T>::value_type,
|
| 148 |
memory_order) noexcept;
|
| 149 |
template<class T>
|
| 150 |
-
T atomic_fetch_and_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 151 |
memory_order) noexcept;
|
| 152 |
template<class T>
|
| 153 |
-
T atomic_fetch_or(volatile atomic<T>*,
|
| 154 |
-
typename atomic<T>::value_type) noexcept;
|
| 155 |
template<class T>
|
| 156 |
-
T atomic_fetch_or(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 157 |
template<class T>
|
| 158 |
-
T atomic_fetch_or_explicit(volatile atomic<T>*,
|
| 159 |
-
typename atomic<T>::value_type,
|
| 160 |
memory_order) noexcept;
|
| 161 |
template<class T>
|
| 162 |
-
T atomic_fetch_or_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 163 |
memory_order) noexcept;
|
| 164 |
template<class T>
|
| 165 |
-
T atomic_fetch_xor(volatile atomic<T>*,
|
| 166 |
-
typename atomic<T>::value_type) noexcept;
|
| 167 |
template<class T>
|
| 168 |
-
T atomic_fetch_xor(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 169 |
template<class T>
|
| 170 |
-
T atomic_fetch_xor_explicit(volatile atomic<T>*,
|
| 171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
memory_order) noexcept;
|
| 173 |
template<class T>
|
| 174 |
-
T
|
| 175 |
memory_order) noexcept;
|
| 176 |
|
| 177 |
template<class T>
|
| 178 |
-
void
|
| 179 |
-
typename atomic<T>::value_type) noexcept;
|
| 180 |
template<class T>
|
| 181 |
-
void
|
| 182 |
template<class T>
|
| 183 |
-
void
|
| 184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
memory_order) noexcept;
|
| 186 |
template<class T>
|
| 187 |
-
void atomic_wait_explicit(const atomic<T>*, typename atomic<T>::value_type,
|
| 188 |
memory_order) noexcept;
|
| 189 |
template<class T>
|
| 190 |
-
void atomic_notify_one(volatile atomic<T>*) noexcept;
|
| 191 |
template<class T>
|
| 192 |
-
void atomic_notify_one(atomic<T>*) noexcept;
|
| 193 |
template<class T>
|
| 194 |
-
void atomic_notify_all(volatile atomic<T>*) noexcept;
|
| 195 |
template<class T>
|
| 196 |
-
void atomic_notify_all(atomic<T>*) noexcept;
|
| 197 |
|
| 198 |
// [atomics.alias], type aliases
|
| 199 |
-
using atomic_bool = atomic<bool>;
|
| 200 |
-
using atomic_char = atomic<char>;
|
| 201 |
-
using atomic_schar = atomic<signed char>;
|
| 202 |
-
using atomic_uchar = atomic<unsigned char>;
|
| 203 |
-
using atomic_short = atomic<short>;
|
| 204 |
-
using atomic_ushort = atomic<unsigned short>;
|
| 205 |
-
using atomic_int = atomic<int>;
|
| 206 |
-
using atomic_uint = atomic<unsigned int>;
|
| 207 |
-
using atomic_long = atomic<long>;
|
| 208 |
-
using atomic_ulong = atomic<unsigned long>;
|
| 209 |
-
using atomic_llong = atomic<long long>;
|
| 210 |
-
using atomic_ullong = atomic<unsigned long long>;
|
| 211 |
-
using atomic_char8_t = atomic<char8_t>;
|
| 212 |
-
using atomic_char16_t = atomic<char16_t>;
|
| 213 |
-
using atomic_char32_t = atomic<char32_t>;
|
| 214 |
-
using atomic_wchar_t = atomic<wchar_t>;
|
| 215 |
|
| 216 |
-
using atomic_int8_t = atomic<int8_t>;
|
| 217 |
-
using atomic_uint8_t = atomic<uint8_t>;
|
| 218 |
-
using atomic_int16_t = atomic<int16_t>;
|
| 219 |
-
using atomic_uint16_t = atomic<uint16_t>;
|
| 220 |
-
using atomic_int32_t = atomic<int32_t>;
|
| 221 |
-
using atomic_uint32_t = atomic<uint32_t>;
|
| 222 |
-
using atomic_int64_t = atomic<int64_t>;
|
| 223 |
-
using atomic_uint64_t = atomic<uint64_t>;
|
| 224 |
|
| 225 |
-
using atomic_int_least8_t = atomic<int_least8_t>;
|
| 226 |
-
using atomic_uint_least8_t = atomic<uint_least8_t>;
|
| 227 |
-
using atomic_int_least16_t = atomic<int_least16_t>;
|
| 228 |
-
using atomic_uint_least16_t = atomic<uint_least16_t>;
|
| 229 |
-
using atomic_int_least32_t = atomic<int_least32_t>;
|
| 230 |
-
using atomic_uint_least32_t = atomic<uint_least32_t>;
|
| 231 |
-
using atomic_int_least64_t = atomic<int_least64_t>;
|
| 232 |
-
using atomic_uint_least64_t = atomic<uint_least64_t>;
|
| 233 |
|
| 234 |
-
using atomic_int_fast8_t = atomic<int_fast8_t>;
|
| 235 |
-
using atomic_uint_fast8_t = atomic<uint_fast8_t>;
|
| 236 |
-
using atomic_int_fast16_t = atomic<int_fast16_t>;
|
| 237 |
-
using atomic_uint_fast16_t = atomic<uint_fast16_t>;
|
| 238 |
-
using atomic_int_fast32_t = atomic<int_fast32_t>;
|
| 239 |
-
using atomic_uint_fast32_t = atomic<uint_fast32_t>;
|
| 240 |
-
using atomic_int_fast64_t = atomic<int_fast64_t>;
|
| 241 |
-
using atomic_uint_fast64_t = atomic<uint_fast64_t>;
|
| 242 |
|
| 243 |
-
using atomic_intptr_t = atomic<intptr_t>;
|
| 244 |
-
using atomic_uintptr_t = atomic<uintptr_t>;
|
| 245 |
-
using atomic_size_t = atomic<size_t>;
|
| 246 |
-
using atomic_ptrdiff_t = atomic<ptrdiff_t>;
|
| 247 |
-
using atomic_intmax_t = atomic<intmax_t>;
|
| 248 |
-
using atomic_uintmax_t = atomic<uintmax_t>;
|
| 249 |
|
| 250 |
-
using atomic_signed_lock_free = see below;
|
| 251 |
-
using atomic_unsigned_lock_free = see below;
|
| 252 |
|
| 253 |
// [atomics.flag], flag type and operations
|
| 254 |
-
struct atomic_flag;
|
| 255 |
|
| 256 |
-
bool atomic_flag_test(const volatile atomic_flag*) noexcept;
|
| 257 |
-
bool atomic_flag_test(const atomic_flag*) noexcept;
|
| 258 |
-
bool atomic_flag_test_explicit(const volatile atomic_flag*,
|
| 259 |
-
|
| 260 |
-
bool
|
| 261 |
-
bool atomic_flag_test_and_set(
|
| 262 |
-
bool
|
| 263 |
-
bool atomic_flag_test_and_set_explicit(
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
void
|
| 267 |
-
void
|
| 268 |
-
void atomic_flag_clear_explicit(volatile atomic_flag*, memory_order) noexcept; // freestanding
|
| 269 |
-
void atomic_flag_clear_explicit(atomic_flag*, memory_order) noexcept; // freestanding
|
| 270 |
|
| 271 |
-
void atomic_flag_wait(const volatile atomic_flag*, bool) noexcept;
|
| 272 |
-
void atomic_flag_wait(const atomic_flag*, bool) noexcept;
|
| 273 |
-
void atomic_flag_wait_explicit(const volatile atomic_flag*,
|
| 274 |
-
|
| 275 |
-
void
|
| 276 |
-
|
| 277 |
-
void
|
| 278 |
-
void
|
| 279 |
-
|
| 280 |
-
void atomic_flag_notify_all(atomic_flag*) noexcept; // freestanding
|
| 281 |
-
#define ATOMIC_FLAG_INIT see belownc // freestanding
|
| 282 |
|
| 283 |
// [atomics.fences], fences
|
| 284 |
-
extern "C" void atomic_thread_fence(memory_order) noexcept;
|
| 285 |
-
extern "C" void atomic_signal_fence(memory_order) noexcept;
|
| 286 |
}
|
| 287 |
```
|
| 288 |
|
|
|
|
| 1 |
### Header `<atomic>` synopsis <a id="atomics.syn">[[atomics.syn]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
// mostly freestanding
|
| 5 |
namespace std {
|
| 6 |
// [atomics.order], order and consistency
|
| 7 |
+
enum class memory_order : unspecified;
|
| 8 |
+
inline constexpr memory_order memory_order_relaxed = memory_order::relaxed;
|
| 9 |
+
inline constexpr memory_order memory_order_acquire = memory_order::acquire;
|
| 10 |
+
inline constexpr memory_order memory_order_release = memory_order::release;
|
| 11 |
+
inline constexpr memory_order memory_order_acq_rel = memory_order::acq_rel;
|
| 12 |
+
inline constexpr memory_order memory_order_seq_cst = memory_order::seq_cst;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
}
|
| 14 |
|
| 15 |
// [atomics.lockfree], lock-free property
|
| 16 |
+
#define ATOMIC_BOOL_LOCK_FREE unspecified
|
| 17 |
+
#define ATOMIC_CHAR_LOCK_FREE unspecified
|
| 18 |
+
#define ATOMIC_CHAR8_T_LOCK_FREE unspecified
|
| 19 |
+
#define ATOMIC_CHAR16_T_LOCK_FREE unspecified
|
| 20 |
+
#define ATOMIC_CHAR32_T_LOCK_FREE unspecified
|
| 21 |
+
#define ATOMIC_WCHAR_T_LOCK_FREE unspecified
|
| 22 |
+
#define ATOMIC_SHORT_LOCK_FREE unspecified
|
| 23 |
+
#define ATOMIC_INT_LOCK_FREE unspecified
|
| 24 |
+
#define ATOMIC_LONG_LOCK_FREE unspecified
|
| 25 |
+
#define ATOMIC_LLONG_LOCK_FREE unspecified
|
| 26 |
+
#define ATOMIC_POINTER_LOCK_FREE unspecified
|
| 27 |
|
| 28 |
namespace std {
|
| 29 |
// [atomics.ref.generic], class template atomic_ref
|
| 30 |
+
template<class T> struct atomic_ref;
|
|
|
|
|
|
|
| 31 |
|
| 32 |
// [atomics.types.generic], class template atomic
|
| 33 |
+
template<class T> struct atomic;
|
| 34 |
// [atomics.types.pointer], partial specialization for pointers
|
| 35 |
+
template<class T> struct atomic<T*>;
|
| 36 |
|
| 37 |
// [atomics.nonmembers], non-member functions
|
| 38 |
template<class T>
|
| 39 |
+
bool atomic_is_lock_free(const volatile atomic<T>*) noexcept;
|
| 40 |
template<class T>
|
| 41 |
+
bool atomic_is_lock_free(const atomic<T>*) noexcept;
|
| 42 |
template<class T>
|
| 43 |
+
void atomic_store(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
|
|
|
| 44 |
template<class T>
|
| 45 |
+
constexpr void atomic_store(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 46 |
template<class T>
|
| 47 |
+
void atomic_store_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
|
|
|
| 48 |
memory_order) noexcept;
|
| 49 |
template<class T>
|
| 50 |
+
constexpr void atomic_store_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 51 |
memory_order) noexcept;
|
| 52 |
template<class T>
|
| 53 |
+
T atomic_load(const volatile atomic<T>*) noexcept;
|
| 54 |
template<class T>
|
| 55 |
+
constexpr T atomic_load(const atomic<T>*) noexcept;
|
| 56 |
template<class T>
|
| 57 |
+
T atomic_load_explicit(const volatile atomic<T>*, memory_order) noexcept;
|
| 58 |
template<class T>
|
| 59 |
+
constexpr T atomic_load_explicit(const atomic<T>*, memory_order) noexcept;
|
| 60 |
template<class T>
|
| 61 |
+
T atomic_exchange(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
|
|
|
| 62 |
template<class T>
|
| 63 |
+
constexpr T atomic_exchange(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 64 |
template<class T>
|
| 65 |
+
T atomic_exchange_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
|
|
|
| 66 |
memory_order) noexcept;
|
| 67 |
template<class T>
|
| 68 |
+
constexpr T atomic_exchange_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 69 |
memory_order) noexcept;
|
| 70 |
template<class T>
|
| 71 |
+
bool atomic_compare_exchange_weak(volatile atomic<T>*,
|
| 72 |
typename atomic<T>::value_type*,
|
| 73 |
typename atomic<T>::value_type) noexcept;
|
| 74 |
template<class T>
|
| 75 |
+
constexpr bool atomic_compare_exchange_weak(atomic<T>*,
|
| 76 |
typename atomic<T>::value_type*,
|
| 77 |
typename atomic<T>::value_type) noexcept;
|
| 78 |
template<class T>
|
| 79 |
+
bool atomic_compare_exchange_strong(volatile atomic<T>*,
|
| 80 |
typename atomic<T>::value_type*,
|
| 81 |
typename atomic<T>::value_type) noexcept;
|
| 82 |
template<class T>
|
| 83 |
+
constexpr bool atomic_compare_exchange_strong(atomic<T>*,
|
| 84 |
typename atomic<T>::value_type*,
|
| 85 |
typename atomic<T>::value_type) noexcept;
|
| 86 |
template<class T>
|
| 87 |
+
bool atomic_compare_exchange_weak_explicit(volatile atomic<T>*,
|
| 88 |
typename atomic<T>::value_type*,
|
| 89 |
typename atomic<T>::value_type,
|
| 90 |
memory_order, memory_order) noexcept;
|
| 91 |
template<class T>
|
| 92 |
+
constexpr bool atomic_compare_exchange_weak_explicit(atomic<T>*,
|
| 93 |
typename atomic<T>::value_type*,
|
| 94 |
typename atomic<T>::value_type,
|
| 95 |
memory_order, memory_order) noexcept;
|
| 96 |
template<class T>
|
| 97 |
+
bool atomic_compare_exchange_strong_explicit(volatile atomic<T>*,
|
| 98 |
typename atomic<T>::value_type*,
|
| 99 |
typename atomic<T>::value_type,
|
| 100 |
memory_order, memory_order) noexcept;
|
| 101 |
template<class T>
|
| 102 |
+
constexpr bool atomic_compare_exchange_strong_explicit(atomic<T>*,
|
| 103 |
typename atomic<T>::value_type*,
|
| 104 |
typename atomic<T>::value_type,
|
| 105 |
memory_order, memory_order) noexcept;
|
| 106 |
|
| 107 |
template<class T>
|
| 108 |
+
T atomic_fetch_add(volatile atomic<T>*, typename atomic<T>::difference_type) noexcept;
|
|
|
|
| 109 |
template<class T>
|
| 110 |
+
constexpr T atomic_fetch_add(atomic<T>*, typename atomic<T>::difference_type) noexcept;
|
| 111 |
template<class T>
|
| 112 |
+
T atomic_fetch_add_explicit(volatile atomic<T>*, typename atomic<T>::difference_type,
|
|
|
|
| 113 |
memory_order) noexcept;
|
| 114 |
template<class T>
|
| 115 |
+
constexpr T atomic_fetch_add_explicit(atomic<T>*, typename atomic<T>::difference_type,
|
| 116 |
memory_order) noexcept;
|
| 117 |
template<class T>
|
| 118 |
+
T atomic_fetch_sub(volatile atomic<T>*, typename atomic<T>::difference_type) noexcept;
|
|
|
|
| 119 |
template<class T>
|
| 120 |
+
constexpr T atomic_fetch_sub(atomic<T>*, typename atomic<T>::difference_type) noexcept;
|
| 121 |
template<class T>
|
| 122 |
+
T atomic_fetch_sub_explicit(volatile atomic<T>*, typename atomic<T>::difference_type,
|
|
|
|
| 123 |
memory_order) noexcept;
|
| 124 |
template<class T>
|
| 125 |
+
constexpr T atomic_fetch_sub_explicit(atomic<T>*, typename atomic<T>::difference_type,
|
| 126 |
memory_order) noexcept;
|
| 127 |
template<class T>
|
| 128 |
+
T atomic_fetch_and(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
|
|
|
| 129 |
template<class T>
|
| 130 |
+
constexpr T atomic_fetch_and(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 131 |
template<class T>
|
| 132 |
+
T atomic_fetch_and_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
|
|
|
| 133 |
memory_order) noexcept;
|
| 134 |
template<class T>
|
| 135 |
+
constexpr T atomic_fetch_and_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 136 |
memory_order) noexcept;
|
| 137 |
template<class T>
|
| 138 |
+
T atomic_fetch_or(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
|
|
|
| 139 |
template<class T>
|
| 140 |
+
constexpr T atomic_fetch_or(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 141 |
template<class T>
|
| 142 |
+
T atomic_fetch_or_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
|
|
|
| 143 |
memory_order) noexcept;
|
| 144 |
template<class T>
|
| 145 |
+
constexpr T atomic_fetch_or_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 146 |
memory_order) noexcept;
|
| 147 |
template<class T>
|
| 148 |
+
T atomic_fetch_xor(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
|
|
|
| 149 |
template<class T>
|
| 150 |
+
constexpr T atomic_fetch_xor(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 151 |
template<class T>
|
| 152 |
+
T atomic_fetch_xor_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
| 153 |
+
memory_order) noexcept;
|
| 154 |
+
template<class T>
|
| 155 |
+
constexpr T atomic_fetch_xor_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 156 |
+
memory_order) noexcept;
|
| 157 |
+
template<class T>
|
| 158 |
+
T atomic_fetch_max(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 159 |
+
template<class T>
|
| 160 |
+
constexpr T atomic_fetch_max(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 161 |
+
template<class T>
|
| 162 |
+
T atomic_fetch_max_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
| 163 |
+
memory_order) noexcept;
|
| 164 |
+
template<class T>
|
| 165 |
+
constexpr T atomic_fetch_max_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 166 |
+
memory_order) noexcept;
|
| 167 |
+
template<class T>
|
| 168 |
+
T atomic_fetch_min(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 169 |
+
template<class T>
|
| 170 |
+
constexpr T atomic_fetch_min(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 171 |
+
template<class T>
|
| 172 |
+
T atomic_fetch_min_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
| 173 |
memory_order) noexcept;
|
| 174 |
template<class T>
|
| 175 |
+
constexpr T atomic_fetch_min_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 176 |
memory_order) noexcept;
|
| 177 |
|
| 178 |
template<class T>
|
| 179 |
+
void atomic_store_add(volatile atomic<T>*, typename atomic<T>::difference_type) noexcept;
|
|
|
|
| 180 |
template<class T>
|
| 181 |
+
constexpr void atomic_store_add(atomic<T>*, typename atomic<T>::difference_type) noexcept;
|
| 182 |
template<class T>
|
| 183 |
+
void atomic_store_add_explicit(volatile atomic<T>*, typename atomic<T>::difference_type,
|
| 184 |
+
memory_order) noexcept;
|
| 185 |
+
template<class T>
|
| 186 |
+
constexpr void atomic_store_add_explicit(atomic<T>*, typename atomic<T>::difference_type,
|
| 187 |
+
memory_order) noexcept;
|
| 188 |
+
template<class T>
|
| 189 |
+
void atomic_store_sub(volatile atomic<T>*, typename atomic<T>::difference_type) noexcept;
|
| 190 |
+
template<class T>
|
| 191 |
+
constexpr void atomic_store_sub(atomic<T>*, typename atomic<T>::difference_type) noexcept;
|
| 192 |
+
template<class T>
|
| 193 |
+
void atomic_store_sub_explicit(volatile atomic<T>*, typename atomic<T>::difference_type,
|
| 194 |
+
memory_order) noexcept;
|
| 195 |
+
template<class T>
|
| 196 |
+
constexpr void atomic_store_sub_explicit(atomic<T>*, typename atomic<T>::difference_type,
|
| 197 |
+
memory_order) noexcept;
|
| 198 |
+
template<class T>
|
| 199 |
+
void atomic_store_and(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 200 |
+
template<class T>
|
| 201 |
+
constexpr void atomic_store_and(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 202 |
+
template<class T>
|
| 203 |
+
void atomic_store_and_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
| 204 |
+
memory_order) noexcept;
|
| 205 |
+
template<class T>
|
| 206 |
+
constexpr void atomic_store_and_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 207 |
+
memory_order) noexcept;
|
| 208 |
+
template<class T>
|
| 209 |
+
void atomic_store_or(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 210 |
+
template<class T>
|
| 211 |
+
constexpr void atomic_store_or(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 212 |
+
template<class T>
|
| 213 |
+
void atomic_store_or_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
| 214 |
+
memory_order) noexcept;
|
| 215 |
+
template<class T>
|
| 216 |
+
constexpr void atomic_store_or_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 217 |
+
memory_order) noexcept;
|
| 218 |
+
template<class T>
|
| 219 |
+
void atomic_store_xor(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 220 |
+
template<class T>
|
| 221 |
+
constexpr void atomic_store_xor(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 222 |
+
template<class T>
|
| 223 |
+
void atomic_store_xor_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
| 224 |
+
memory_order) noexcept;
|
| 225 |
+
template<class T>
|
| 226 |
+
constexpr void atomic_store_xor_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 227 |
+
memory_order) noexcept;
|
| 228 |
+
template<class T>
|
| 229 |
+
void atomic_store_max(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 230 |
+
template<class T>
|
| 231 |
+
constexpr void atomic_store_max(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 232 |
+
template<class T>
|
| 233 |
+
void atomic_store_max_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
| 234 |
+
memory_order) noexcept;
|
| 235 |
+
template<class T>
|
| 236 |
+
constexpr void atomic_store_max_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 237 |
+
memory_order) noexcept;
|
| 238 |
+
template<class T>
|
| 239 |
+
void atomic_store_min(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 240 |
+
template<class T>
|
| 241 |
+
constexpr void atomic_store_min(atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 242 |
+
template<class T>
|
| 243 |
+
void atomic_store_min_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
|
| 244 |
+
memory_order) noexcept;
|
| 245 |
+
template<class T>
|
| 246 |
+
constexpr void atomic_store_min_explicit(atomic<T>*, typename atomic<T>::value_type,
|
| 247 |
+
memory_order) noexcept;
|
| 248 |
+
|
| 249 |
+
template<class T>
|
| 250 |
+
void atomic_wait(const volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 251 |
+
template<class T>
|
| 252 |
+
constexpr void atomic_wait(const atomic<T>*, typename atomic<T>::value_type) noexcept;
|
| 253 |
+
template<class T>
|
| 254 |
+
void atomic_wait_explicit(const volatile atomic<T>*, typename atomic<T>::value_type,
|
| 255 |
memory_order) noexcept;
|
| 256 |
template<class T>
|
| 257 |
+
constexpr void atomic_wait_explicit(const atomic<T>*, typename atomic<T>::value_type,
|
| 258 |
memory_order) noexcept;
|
| 259 |
template<class T>
|
| 260 |
+
void atomic_notify_one(volatile atomic<T>*) noexcept;
|
| 261 |
template<class T>
|
| 262 |
+
constexpr void atomic_notify_one(atomic<T>*) noexcept;
|
| 263 |
template<class T>
|
| 264 |
+
void atomic_notify_all(volatile atomic<T>*) noexcept;
|
| 265 |
template<class T>
|
| 266 |
+
constexpr void atomic_notify_all(atomic<T>*) noexcept;
|
| 267 |
|
| 268 |
// [atomics.alias], type aliases
|
| 269 |
+
using atomic_bool = atomic<bool>;
|
| 270 |
+
using atomic_char = atomic<char>;
|
| 271 |
+
using atomic_schar = atomic<signed char>;
|
| 272 |
+
using atomic_uchar = atomic<unsigned char>;
|
| 273 |
+
using atomic_short = atomic<short>;
|
| 274 |
+
using atomic_ushort = atomic<unsigned short>;
|
| 275 |
+
using atomic_int = atomic<int>;
|
| 276 |
+
using atomic_uint = atomic<unsigned int>;
|
| 277 |
+
using atomic_long = atomic<long>;
|
| 278 |
+
using atomic_ulong = atomic<unsigned long>;
|
| 279 |
+
using atomic_llong = atomic<long long>;
|
| 280 |
+
using atomic_ullong = atomic<unsigned long long>;
|
| 281 |
+
using atomic_char8_t = atomic<char8_t>;
|
| 282 |
+
using atomic_char16_t = atomic<char16_t>;
|
| 283 |
+
using atomic_char32_t = atomic<char32_t>;
|
| 284 |
+
using atomic_wchar_t = atomic<wchar_t>;
|
| 285 |
|
| 286 |
+
using atomic_int8_t = atomic<int8_t>;
|
| 287 |
+
using atomic_uint8_t = atomic<uint8_t>;
|
| 288 |
+
using atomic_int16_t = atomic<int16_t>;
|
| 289 |
+
using atomic_uint16_t = atomic<uint16_t>;
|
| 290 |
+
using atomic_int32_t = atomic<int32_t>;
|
| 291 |
+
using atomic_uint32_t = atomic<uint32_t>;
|
| 292 |
+
using atomic_int64_t = atomic<int64_t>;
|
| 293 |
+
using atomic_uint64_t = atomic<uint64_t>;
|
| 294 |
|
| 295 |
+
using atomic_int_least8_t = atomic<int_least8_t>;
|
| 296 |
+
using atomic_uint_least8_t = atomic<uint_least8_t>;
|
| 297 |
+
using atomic_int_least16_t = atomic<int_least16_t>;
|
| 298 |
+
using atomic_uint_least16_t = atomic<uint_least16_t>;
|
| 299 |
+
using atomic_int_least32_t = atomic<int_least32_t>;
|
| 300 |
+
using atomic_uint_least32_t = atomic<uint_least32_t>;
|
| 301 |
+
using atomic_int_least64_t = atomic<int_least64_t>;
|
| 302 |
+
using atomic_uint_least64_t = atomic<uint_least64_t>;
|
| 303 |
|
| 304 |
+
using atomic_int_fast8_t = atomic<int_fast8_t>;
|
| 305 |
+
using atomic_uint_fast8_t = atomic<uint_fast8_t>;
|
| 306 |
+
using atomic_int_fast16_t = atomic<int_fast16_t>;
|
| 307 |
+
using atomic_uint_fast16_t = atomic<uint_fast16_t>;
|
| 308 |
+
using atomic_int_fast32_t = atomic<int_fast32_t>;
|
| 309 |
+
using atomic_uint_fast32_t = atomic<uint_fast32_t>;
|
| 310 |
+
using atomic_int_fast64_t = atomic<int_fast64_t>;
|
| 311 |
+
using atomic_uint_fast64_t = atomic<uint_fast64_t>;
|
| 312 |
|
| 313 |
+
using atomic_intptr_t = atomic<intptr_t>;
|
| 314 |
+
using atomic_uintptr_t = atomic<uintptr_t>;
|
| 315 |
+
using atomic_size_t = atomic<size_t>;
|
| 316 |
+
using atomic_ptrdiff_t = atomic<ptrdiff_t>;
|
| 317 |
+
using atomic_intmax_t = atomic<intmax_t>;
|
| 318 |
+
using atomic_uintmax_t = atomic<uintmax_t>;
|
| 319 |
|
| 320 |
+
using atomic_signed_lock_free = see below; // hosted
|
| 321 |
+
using atomic_unsigned_lock_free = see below; // hosted
|
| 322 |
|
| 323 |
// [atomics.flag], flag type and operations
|
| 324 |
+
struct atomic_flag;
|
| 325 |
|
| 326 |
+
bool atomic_flag_test(const volatile atomic_flag*) noexcept;
|
| 327 |
+
constexpr bool atomic_flag_test(const atomic_flag*) noexcept;
|
| 328 |
+
bool atomic_flag_test_explicit(const volatile atomic_flag*, memory_order) noexcept;
|
| 329 |
+
constexpr bool atomic_flag_test_explicit(const atomic_flag*, memory_order) noexcept;
|
| 330 |
+
bool atomic_flag_test_and_set(volatile atomic_flag*) noexcept;
|
| 331 |
+
constexpr bool atomic_flag_test_and_set(atomic_flag*) noexcept;
|
| 332 |
+
bool atomic_flag_test_and_set_explicit(volatile atomic_flag*, memory_order) noexcept;
|
| 333 |
+
constexpr bool atomic_flag_test_and_set_explicit(atomic_flag*, memory_order) noexcept;
|
| 334 |
+
void atomic_flag_clear(volatile atomic_flag*) noexcept;
|
| 335 |
+
constexpr void atomic_flag_clear(atomic_flag*) noexcept;
|
| 336 |
+
void atomic_flag_clear_explicit(volatile atomic_flag*, memory_order) noexcept;
|
| 337 |
+
constexpr void atomic_flag_clear_explicit(atomic_flag*, memory_order) noexcept;
|
|
|
|
|
|
|
| 338 |
|
| 339 |
+
void atomic_flag_wait(const volatile atomic_flag*, bool) noexcept;
|
| 340 |
+
constexpr void atomic_flag_wait(const atomic_flag*, bool) noexcept;
|
| 341 |
+
void atomic_flag_wait_explicit(const volatile atomic_flag*, bool, memory_order) noexcept;
|
| 342 |
+
constexpr void atomic_flag_wait_explicit(const atomic_flag*, bool, memory_order) noexcept;
|
| 343 |
+
void atomic_flag_notify_one(volatile atomic_flag*) noexcept;
|
| 344 |
+
constexpr void atomic_flag_notify_one(atomic_flag*) noexcept;
|
| 345 |
+
void atomic_flag_notify_all(volatile atomic_flag*) noexcept;
|
| 346 |
+
constexpr void atomic_flag_notify_all(atomic_flag*) noexcept;
|
| 347 |
+
#define ATOMIC_FLAG_INIT see belownc
|
|
|
|
|
|
|
| 348 |
|
| 349 |
// [atomics.fences], fences
|
| 350 |
+
extern "C" constexpr void atomic_thread_fence(memory_order) noexcept;
|
| 351 |
+
extern "C" constexpr void atomic_signal_fence(memory_order) noexcept;
|
| 352 |
}
|
| 353 |
```
|
| 354 |
|