mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-28 02:30:05 +00:00
Fixed a problem in a static assert in Atomic.
This commit is contained in:
parent
f08aa821b6
commit
d05594eafe
1 changed files with 4 additions and 4 deletions
|
|
@ -45,7 +45,7 @@ namespace juce
|
|||
Atomic() noexcept : value (0) {}
|
||||
|
||||
/** Creates a new value, with a given initial value. */
|
||||
Atomic (const Type initialValue) noexcept : value (initialValue) {}
|
||||
Atomic (Type initialValue) noexcept : value (initialValue) {}
|
||||
|
||||
/** Copies another value (atomically). */
|
||||
Atomic (const Atomic& other) noexcept : value (other.get()) {}
|
||||
|
|
@ -54,7 +54,7 @@ namespace juce
|
|||
~Atomic() noexcept
|
||||
{
|
||||
#if __cpp_lib_atomic_is_always_lock_free
|
||||
static_assert (std::atomic<Type>::is_always_lock_free(),
|
||||
static_assert (std::atomic<Type>::is_always_lock_free,
|
||||
"This class can only be used for lock-free types");
|
||||
#endif
|
||||
}
|
||||
|
|
@ -105,7 +105,7 @@ namespace juce
|
|||
}
|
||||
|
||||
/** Copies another value into this one (atomically). */
|
||||
Atomic<Type>& operator= (const Type newValue) noexcept
|
||||
Atomic<Type>& operator= (Type newValue) noexcept
|
||||
{
|
||||
value = newValue;
|
||||
return *this;
|
||||
|
|
@ -128,7 +128,7 @@ namespace juce
|
|||
Internally this calls std::atomic_thread_fence with
|
||||
memory_order_seq_cst (the strictest std::memory_order).
|
||||
*/
|
||||
void memoryBarrier() noexcept { atomic_thread_fence (std::memory_order_seq_cst); }
|
||||
void memoryBarrier() noexcept { atomic_thread_fence (std::memory_order_seq_cst); }
|
||||
|
||||
/** The std::atomic object that this class operates on. */
|
||||
std::atomic<Type> value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue