11 static_assert(!std::is_array<T>::value,
"cAtomicUniquePtr does not support arrays");
21 m_Ptr(a_Ptr.release())
27 store(std::move(a_Ptr));
36 operator T * ()
const noexcept
41 bool compare_exchange_weak(T *& a_Expected, std::unique_ptr<T> && a_Desired, std::memory_order a_Order = std::memory_order_seq_cst) noexcept
43 bool DidExchange =
m_Ptr.compare_exchange_weak(a_Expected, a_Desired.get(), a_Order);
52 bool compare_exchange_strong(T *& a_Expected, std::unique_ptr<T> && a_Desired, std::memory_order a_Order = std::memory_order_seq_cst) noexcept
54 bool DidExchange =
m_Ptr.compare_exchange_strong(a_Expected, a_Desired.get(), a_Order);
63 std::unique_ptr<T>
exchange(std::unique_ptr<T> a_Ptr, std::memory_order a_Order = std::memory_order_seq_cst) noexcept
65 return std::unique_ptr<T>{
m_Ptr.exchange(a_Ptr.release(), a_Order) };
68 T *
load(std::memory_order a_Order = std::memory_order_seq_cst)
const noexcept
70 return m_Ptr.load(a_Order);
73 void store(std::unique_ptr<T> a_Ptr, std::memory_order a_Order = std::memory_order_seq_cst) noexcept
76 delete m_Ptr.exchange(a_Ptr.release(), a_Order);
An RAII wrapper for std::atomic<T*>.
void store(std::unique_ptr< T > a_Ptr, std::memory_order a_Order=std::memory_order_seq_cst) noexcept
cAtomicUniquePtr & operator=(std::unique_ptr< T > a_Ptr) noexcept
DISALLOW_COPY_AND_ASSIGN(cAtomicUniquePtr)
std::unique_ptr< T > exchange(std::unique_ptr< T > a_Ptr, std::memory_order a_Order=std::memory_order_seq_cst) noexcept
cAtomicUniquePtr(std::unique_ptr< T > a_Ptr) noexcept
bool compare_exchange_strong(T *&a_Expected, std::unique_ptr< T > &&a_Desired, std::memory_order a_Order=std::memory_order_seq_cst) noexcept
cAtomicUniquePtr() noexcept
~cAtomicUniquePtr() noexcept
bool compare_exchange_weak(T *&a_Expected, std::unique_ptr< T > &&a_Desired, std::memory_order a_Order=std::memory_order_seq_cst) noexcept
T * load(std::memory_order a_Order=std::memory_order_seq_cst) const noexcept