From Jason Turner

[atomics.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpzwd9fbdu/{from.md → to.md} +149 -97
tmp/tmpzwd9fbdu/{from.md → to.md} RENAMED
@@ -17,142 +17,194 @@ namespace std {
17
  #define ATOMIC_INT_LOCK_FREE unspecified
18
  #define ATOMIC_LONG_LOCK_FREE unspecified
19
  #define ATOMIC_LLONG_LOCK_FREE unspecified
20
  #define ATOMIC_POINTER_LOCK_FREE unspecified
21
 
22
- // [atomics.types.generic], generic types
23
  template<class T> struct atomic;
24
- template<> struct atomic<integral>;
25
  template<class T> struct atomic<T*>;
26
 
27
- // [atomics.types.operations.general], general operations on atomic types
28
- // In the following declarations, atomic-type is either
29
- // atomic<T> or a named base class for T from
30
- // Table~[tab:atomics.integral] or inferred from Table~[tab:atomics.typedefs] or from bool.
31
- // If it is atomic<T>, then the declaration is a template
32
- // declaration prefixed with template <class T>.
33
- bool atomic_is_lock_free(const volatile atomic-type*) noexcept;
34
- bool atomic_is_lock_free(const atomic-type*) noexcept;
35
- void atomic_init(volatile atomic-type*, T) noexcept;
36
- void atomic_init(atomic-type*, T) noexcept;
37
- void atomic_store(volatile atomic-type*, T) noexcept;
38
- void atomic_store(atomic-type*, T) noexcept;
39
- void atomic_store_explicit(volatile atomic-type*, T, memory_order) noexcept;
40
- void atomic_store_explicit(atomic-type*, T, memory_order) noexcept;
41
- T atomic_load(const volatile atomic-type*) noexcept;
42
- T atomic_load(const atomic-type*) noexcept;
43
- T atomic_load_explicit(const volatile atomic-type*, memory_order) noexcept;
44
- T atomic_load_explicit(const atomic-type*, memory_order) noexcept;
45
- T atomic_exchange(volatile atomic-type*, T) noexcept;
46
- T atomic_exchange(atomic-type*, T) noexcept;
47
- T atomic_exchange_explicit(volatile atomic-type*, T, memory_order) noexcept;
48
- T atomic_exchange_explicit(atomic-type*, T, memory_order) noexcept;
49
- bool atomic_compare_exchange_weak(volatile atomic-type*, T*, T) noexcept;
50
- bool atomic_compare_exchange_weak(atomic-type*, T*, T) noexcept;
51
- bool atomic_compare_exchange_strong(volatile atomic-type*, T*, T) noexcept;
52
- bool atomic_compare_exchange_strong(atomic-type*, T*, T) noexcept;
53
- bool atomic_compare_exchange_weak_explicit(volatile atomic-type*, T*, T,
54
- memory_order, memory_order) noexcept;
55
- bool atomic_compare_exchange_weak_explicit(atomic-type*, T*, T,
56
- memory_order, memory_order) noexcept;
57
- bool atomic_compare_exchange_strong_explicit(volatile atomic-type*, T*, T,
58
- memory_order, memory_order) noexcept;
59
- bool atomic_compare_exchange_strong_explicit(atomic-type*, T*, T,
60
- memory_order, memory_order) noexcept;
61
-
62
- // [atomics.types.operations.templ], templated operations on atomic types
63
  template<class T>
64
- T atomic_fetch_add(volatile atomic<T>*, T) noexcept;
65
  template<class T>
66
- T atomic_fetch_add(atomic<T>*, T) noexcept;
67
  template<class T>
68
- T atomic_fetch_add_explicit(volatile atomic<T>*, T, memory_order) noexcept;
69
  template<class T>
70
- T atomic_fetch_add_explicit(atomic<T>*, T, memory_order) noexcept;
71
  template<class T>
72
- T atomic_fetch_sub(volatile atomic<T>*, T) noexcept;
73
  template<class T>
74
- T atomic_fetch_sub(atomic<T>*, T) noexcept;
75
  template<class T>
76
- T atomic_fetch_sub_explicit(volatile atomic<T>*, T, memory_order) noexcept;
 
77
  template<class T>
78
- T atomic_fetch_sub_explicit(atomic<T>*, T, memory_order) noexcept;
 
79
  template<class T>
80
- T atomic_fetch_and(volatile atomic<T>*, T) noexcept;
81
  template<class T>
82
- T atomic_fetch_and(atomic<T>*, T) noexcept;
83
  template<class T>
84
- T atomic_fetch_and_explicit(volatile atomic<T>*, T, memory_order) noexcept;
85
  template<class T>
86
- T atomic_fetch_and_explicit(atomic<T>*, T, memory_order) noexcept;
87
  template<class T>
88
- T atomic_fetch_or(volatile atomic<T>*, T) noexcept;
89
  template<class T>
90
- T atomic_fetch_or(atomic<T>*, T) noexcept;
91
  template<class T>
92
- T atomic_fetch_or_explicit(volatile atomic<T>*, T, memory_order) noexcept;
 
93
  template<class T>
94
- T atomic_fetch_or_explicit(atomic<T>*, T, memory_order) noexcept;
 
95
  template<class T>
96
- T atomic_fetch_xor(volatile atomic<T>*, T) noexcept;
 
 
97
  template<class T>
98
- T atomic_fetch_xor(atomic<T>*, T) noexcept;
 
 
99
  template<class T>
100
- T atomic_fetch_xor_explicit(volatile atomic<T>*, T, memory_order) noexcept;
 
 
101
  template<class T>
102
- T atomic_fetch_xor_explicit(atomic<T>*, T, memory_order) noexcept;
103
-
104
- // [atomics.types.operations.arith], arithmetic operations on atomic types
105
- // In the following declarations, atomic-integral is either
106
- // atomic<T> or a named base class for T from
107
- // Table~[tab:atomics.integral] or inferred from Table~[tab:atomics.typedefs].
108
- // If it is atomic<T>, then the declaration is a template
109
- // specialization declaration prefixed with template <>.
110
-
111
- integral atomic_fetch_add(volatile atomic-integral*, integral) noexcept;
112
- integral atomic_fetch_add(atomic-integral*, integral) noexcept;
113
- integral atomic_fetch_add_explicit(volatile atomic-integral*, integral, memory_order) noexcept;
114
- integral atomic_fetch_add_explicit(atomic-integral*, integral, memory_order) noexcept;
115
- integral atomic_fetch_sub(volatile atomic-integral*, integral) noexcept;
116
- integral atomic_fetch_sub(atomic-integral*, integral) noexcept;
117
- integral atomic_fetch_sub_explicit(volatile atomic-integral*, integral, memory_order) noexcept;
118
- integral atomic_fetch_sub_explicit(atomic-integral*, integral, memory_order) noexcept;
119
- integral atomic_fetch_and(volatile atomic-integral*, integral) noexcept;
120
- integral atomic_fetch_and(atomic-integral*, integral) noexcept;
121
- integral atomic_fetch_and_explicit(volatile atomic-integral*, integral, memory_order) noexcept;
122
- integral atomic_fetch_and_explicit(atomic-integral*, integral, memory_order) noexcept;
123
- integral atomic_fetch_or(volatile atomic-integral*, integral) noexcept;
124
- integral atomic_fetch_or(atomic-integral*, integral) noexcept;
125
- integral atomic_fetch_or_explicit(volatile atomic-integral*, integral, memory_order) noexcept;
126
- integral atomic_fetch_or_explicit(atomic-integral*, integral, memory_order) noexcept;
127
- integral atomic_fetch_xor(volatile atomic-integral*, integral) noexcept;
128
- integral atomic_fetch_xor(atomic-integral*, integral) noexcept;
129
- integral atomic_fetch_xor_explicit(volatile atomic-integral*, integral, memory_order) noexcept;
130
- integral atomic_fetch_xor_explicit(atomic-integral*, integral, memory_order) noexcept;
131
-
132
- // [atomics.types.operations.pointer], partial specializations for pointers
133
 
134
  template <class T>
135
- T* atomic_fetch_add(volatile atomic<T*>*, ptrdiff_t) noexcept;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  template <class T>
137
- T* atomic_fetch_add(atomic<T*>*, ptrdiff_t) noexcept;
138
  template <class T>
139
- T* atomic_fetch_add_explicit(volatile atomic<T*>*, ptrdiff_t, memory_order) noexcept;
 
140
  template <class T>
141
- T* atomic_fetch_add_explicit(atomic<T*>*, ptrdiff_t, memory_order) noexcept;
 
142
  template <class T>
143
- T* atomic_fetch_sub(volatile atomic<T*>*, ptrdiff_t) noexcept;
144
  template <class T>
145
- T* atomic_fetch_sub(atomic<T*>*, ptrdiff_t) noexcept;
146
  template <class T>
147
- T* atomic_fetch_sub_explicit(volatile atomic<T*>*, ptrdiff_t, memory_order) noexcept;
 
148
  template <class T>
149
- T* atomic_fetch_sub_explicit(atomic<T*>*, ptrdiff_t, memory_order) noexcept;
 
150
 
151
- // [atomics.types.operations.req], initialization
152
  #define ATOMIC_VAR_INIT(value) see below
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  // [atomics.flag], flag type and operations
155
  struct atomic_flag;
156
  bool atomic_flag_test_and_set(volatile atomic_flag*) noexcept;
157
  bool atomic_flag_test_and_set(atomic_flag*) noexcept;
158
  bool atomic_flag_test_and_set_explicit(volatile atomic_flag*, memory_order) noexcept;
 
17
  #define ATOMIC_INT_LOCK_FREE unspecified
18
  #define ATOMIC_LONG_LOCK_FREE unspecified
19
  #define ATOMIC_LLONG_LOCK_FREE unspecified
20
  #define ATOMIC_POINTER_LOCK_FREE unspecified
21
 
22
+ // [atomics.types.generic], atomic
23
  template<class T> struct atomic;
24
+ // [atomics.types.pointer], partial specialization for pointers
25
  template<class T> struct atomic<T*>;
26
 
27
+ // [atomics.nonmembers], non-member functions
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  template<class T>
29
+ bool atomic_is_lock_free(const volatile atomic<T>*) noexcept;
30
  template<class T>
31
+ bool atomic_is_lock_free(const atomic<T>*) noexcept;
32
  template<class T>
33
+ void atomic_init(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
34
  template<class T>
35
+ void atomic_init(atomic<T>*, typename atomic<T>::value_type) noexcept;
36
  template<class T>
37
+ void atomic_store(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
38
  template<class T>
39
+ void atomic_store(atomic<T>*, typename atomic<T>::value_type) noexcept;
40
  template<class T>
41
+ void atomic_store_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
42
+ memory_order) noexcept;
43
  template<class T>
44
+ void atomic_store_explicit(atomic<T>*, typename atomic<T>::value_type,
45
+ memory_order) noexcept;
46
  template<class T>
47
+ T atomic_load(const volatile atomic<T>*) noexcept;
48
  template<class T>
49
+ T atomic_load(const atomic<T>*) noexcept;
50
  template<class T>
51
+ T atomic_load_explicit(const volatile atomic<T>*, memory_order) noexcept;
52
  template<class T>
53
+ T atomic_load_explicit(const atomic<T>*, memory_order) noexcept;
54
  template<class T>
55
+ T atomic_exchange(volatile atomic<T>*, T) noexcept;
56
  template<class T>
57
+ T atomic_exchange(atomic<T>*, typename atomic<T>::value_type) noexcept;
58
  template<class T>
59
+ T atomic_exchange_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
60
+ memory_order) noexcept;
61
  template<class T>
62
+ T atomic_exchange_explicit(atomic<T>*, typename atomic<T>::value_type,
63
+ memory_order) noexcept;
64
  template<class T>
65
+ bool atomic_compare_exchange_weak(volatile atomic<T>*,
66
+ typename atomic<T>::value_type*,
67
+ typename atomic<T>::value_type) noexcept;
68
  template<class T>
69
+ bool atomic_compare_exchange_weak(atomic<T>*,
70
+ typename atomic<T>::value_type*,
71
+ typename atomic<T>::value_type) noexcept;
72
  template<class T>
73
+ bool atomic_compare_exchange_strong(volatile atomic<T>*,
74
+ typename atomic<T>::value_type*,
75
+ typename atomic<T>::value_type) noexcept;
76
  template<class T>
77
+ bool atomic_compare_exchange_strong(atomic<T>*,
78
+ typename atomic<T>::value_type*,
79
+ typename atomic<T>::value_type) noexcept;
80
+ template<class T>
81
+ bool atomic_compare_exchange_weak_explicit(volatile atomic<T>*,
82
+ typename atomic<T>::value_type*,
83
+ typename atomic<T>::value_type,
84
+ memory_order, memory_order) noexcept;
85
+ template<class T>
86
+ bool atomic_compare_exchange_weak_explicit(atomic<T>*,
87
+ typename atomic<T>::value_type*,
88
+ typename atomic<T>::value_type,
89
+ memory_order, memory_order) noexcept;
90
+ template<class T>
91
+ bool atomic_compare_exchange_strong_explicit(volatile atomic<T>*,
92
+ typename atomic<T>::value_type*,
93
+ typename atomic<T>::value_type,
94
+ memory_order, memory_order) noexcept;
95
+ template<class T>
96
+ bool atomic_compare_exchange_strong_explicit(atomic<T>*,
97
+ typename atomic<T>::value_type*,
98
+ typename atomic<T>::value_type,
99
+ memory_order, memory_order) noexcept;
 
 
 
 
 
 
 
 
100
 
101
  template <class T>
102
+ T atomic_fetch_add(volatile atomic<T>*, typename atomic<T>::difference_type) noexcept;
103
+ template <class T>
104
+ T atomic_fetch_add(atomic<T>*, typename atomic<T>::difference_type) noexcept;
105
+ template <class T>
106
+ T atomic_fetch_add_explicit(volatile atomic<T>*, typename atomic<T>::difference_type,
107
+ memory_order) noexcept;
108
+ template <class T>
109
+ T atomic_fetch_add_explicit(atomic<T>*, typename atomic<T>::difference_type,
110
+ memory_order) noexcept;
111
+ template <class T>
112
+ T atomic_fetch_sub(volatile atomic<T>*, typename atomic<T>::difference_type) noexcept;
113
+ template <class T>
114
+ T atomic_fetch_sub(atomic<T>*, typename atomic<T>::difference_type) noexcept;
115
+ template <class T>
116
+ T atomic_fetch_sub_explicit(volatile atomic<T>*, typename atomic<T>::difference_type,
117
+ memory_order) noexcept;
118
+ template <class T>
119
+ T atomic_fetch_sub_explicit(atomic<T>*, typename atomic<T>::difference_type,
120
+ memory_order) noexcept;
121
+ template <class T>
122
+ T atomic_fetch_and(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
123
+ template <class T>
124
+ T atomic_fetch_and(atomic<T>*, typename atomic<T>::value_type) noexcept;
125
+ template <class T>
126
+ T atomic_fetch_and_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
127
+ memory_order) noexcept;
128
+ template <class T>
129
+ T atomic_fetch_and_explicit(atomic<T>*, typename atomic<T>::value_type,
130
+ memory_order) noexcept;
131
+ template <class T>
132
+ T atomic_fetch_or(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
133
  template <class T>
134
+ T atomic_fetch_or(atomic<T>*, typename atomic<T>::value_type) noexcept;
135
  template <class T>
136
+ T atomic_fetch_or_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
137
+ memory_order) noexcept;
138
  template <class T>
139
+ T atomic_fetch_or_explicit(atomic<T>*, typename atomic<T>::value_type,
140
+ memory_order) noexcept;
141
  template <class T>
142
+ T atomic_fetch_xor(volatile atomic<T>*, typename atomic<T>::value_type) noexcept;
143
  template <class T>
144
+ T atomic_fetch_xor(atomic<T>*, typename atomic<T>::value_type) noexcept;
145
  template <class T>
146
+ T atomic_fetch_xor_explicit(volatile atomic<T>*, typename atomic<T>::value_type,
147
+ memory_order) noexcept;
148
  template <class T>
149
+ T atomic_fetch_xor_explicit(atomic<T>*, typename atomic<T>::value_type,
150
+ memory_order) noexcept;
151
 
152
+ // [atomics.types.operations], initialization
153
  #define ATOMIC_VAR_INIT(value) see below
154
 
155
+ // [atomics.alias], type aliases
156
+ using atomic_bool = atomic<bool>;
157
+ using atomic_char = atomic<char>;
158
+ using atomic_schar = atomic<signed char>;
159
+ using atomic_uchar = atomic<unsigned char>;
160
+ using atomic_short = atomic<short>;
161
+ using atomic_ushort = atomic<unsigned short>;
162
+ using atomic_int = atomic<int>;
163
+ using atomic_uint = atomic<unsigned int>;
164
+ using atomic_long = atomic<long>;
165
+ using atomic_ulong = atomic<unsigned long>;
166
+ using atomic_llong = atomic<long long>;
167
+ using atomic_ullong = atomic<unsigned long long>;
168
+ using atomic_char16_t = atomic<char16_t>;
169
+ using atomic_char32_t = atomic<char32_t>;
170
+ using atomic_wchar_t = atomic<wchar_t>;
171
+
172
+ using atomic_int8_t = atomic<int8_t>;
173
+ using atomic_uint8_t = atomic<uint8_t>;
174
+ using atomic_int16_t = atomic<int16_t>;
175
+ using atomic_uint16_t = atomic<uint16_t>;
176
+ using atomic_int32_t = atomic<int32_t>;
177
+ using atomic_uint32_t = atomic<uint32_t>;
178
+ using atomic_int64_t = atomic<int64_t>;
179
+ using atomic_uint64_t = atomic<uint64_t>;
180
+
181
+ using atomic_int_least8_t = atomic<int_least8_t>;
182
+ using atomic_uint_least8_t = atomic<uint_least8_t>;
183
+ using atomic_int_least16_t = atomic<int_least16_t>;
184
+ using atomic_uint_least16_t = atomic<uint_least16_t>;
185
+ using atomic_int_least32_t = atomic<int_least32_t>;
186
+ using atomic_uint_least32_t = atomic<uint_least32_t>;
187
+ using atomic_int_least64_t = atomic<int_least64_t>;
188
+ using atomic_uint_least64_t = atomic<uint_least64_t>;
189
+
190
+ using atomic_int_fast8_t = atomic<int_fast8_t>;
191
+ using atomic_uint_fast8_t = atomic<uint_fast8_t>;
192
+ using atomic_int_fast16_t = atomic<int_fast16_t>;
193
+ using atomic_uint_fast16_t = atomic<uint_fast16_t>;
194
+ using atomic_int_fast32_t = atomic<int_fast32_t>;
195
+ using atomic_uint_fast32_t = atomic<uint_fast32_t>;
196
+ using atomic_int_fast64_t = atomic<int_fast64_t>;
197
+ using atomic_uint_fast64_t = atomic<uint_fast64_t>;
198
+
199
+ using atomic_intptr_t = atomic<intptr_t>;
200
+ using atomic_uintptr_t = atomic<uintptr_t>;
201
+ using atomic_size_t = atomic<size_t>;
202
+ using atomic_ptrdiff_t = atomic<ptrdiff_t>;
203
+ using atomic_intmax_t = atomic<intmax_t>;
204
+ using atomic_uintmax_t = atomic<uintmax_t>;
205
+
206
  // [atomics.flag], flag type and operations
207
  struct atomic_flag;
208
  bool atomic_flag_test_and_set(volatile atomic_flag*) noexcept;
209
  bool atomic_flag_test_and_set(atomic_flag*) noexcept;
210
  bool atomic_flag_test_and_set_explicit(volatile atomic_flag*, memory_order) noexcept;