File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -12,32 +12,25 @@ namespace icinga
12
12
{
13
13
14
14
/* *
15
- * Extends std::atomic with an atomic constructor.
15
+ * Like std::atomic, but enforces usage of its only safe constructor.
16
+ *
17
+ * "The default-initialized std::atomic<T> does not contain a T object,
18
+ * and its only valid uses are destruction and
19
+ * initialization by std::atomic_init, see LWG issue 2334."
20
+ * -- https://en.cppreference.com/w/cpp/atomic/atomic/atomic
16
21
*
17
22
* @ingroup base
18
23
*/
19
24
template <class T >
20
25
class Atomic : public std ::atomic<T> {
21
26
public:
22
27
/* *
23
- * Like std::atomic#atomic, but operates atomically
24
- *
25
- * @param desired Initial value
26
- */
27
- inline Atomic (T desired)
28
- {
29
- this ->store (desired);
30
- }
31
-
32
- /* *
33
- * Like std::atomic#atomic, but operates atomically
28
+ * The only safe constructor of std::atomic#atomic
34
29
*
35
30
* @param desired Initial value
36
- * @param order Initial store operation's memory order
37
31
*/
38
- inline Atomic (T desired, std::memory_order order )
32
+ inline Atomic (T desired) : std::atomic<T>(desired )
39
33
{
40
- this ->store (desired, order);
41
34
}
42
35
};
43
36
You can’t perform that action at this time.
0 commit comments