mirror of https://github.com/Icinga/icinga2.git
Atomic<T>#Atomic(T): fix C++ compliance
by not calling `std::atomic<T>::atomic(void)`. After the latter the instance "does not contain a T object, and its only valid uses are destruction and initialization by std::atomic_init" which we don't call. So the only safe option is `std::atomic<T>::atomic(T)`. https://en.cppreference.com/w/cpp/atomic/atomic/atomic
This commit is contained in:
parent
d894792c36
commit
a77259adc1
|
@ -24,7 +24,7 @@ public:
|
|||
*
|
||||
* @param desired Initial value
|
||||
*/
|
||||
inline Atomic(T desired)
|
||||
inline Atomic(T desired) : std::atomic<T>(desired)
|
||||
{
|
||||
this->store(desired);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public:
|
|||
* @param desired Initial value
|
||||
* @param order Initial store operation's memory order
|
||||
*/
|
||||
inline Atomic(T desired, std::memory_order order)
|
||||
inline Atomic(T desired, std::memory_order order) : std::atomic<T>(desired)
|
||||
{
|
||||
this->store(desired, order);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue