diff --git a/include/boost/atomic/detail/atomic_template.hpp b/include/boost/atomic/detail/atomic_template.hpp index 10c1f3e..80d6b7d 100644 --- a/include/boost/atomic/detail/atomic_template.hpp +++ b/include/boost/atomic/detail/atomic_template.hpp @@ -181,11 +181,6 @@ public: return compare_exchange_weak(expected, desired, order, atomics::detail::deduce_failure_order(order)); } - BOOST_FORCEINLINE bool is_lock_free() const volatile BOOST_NOEXCEPT - { - return operations::is_lock_free(m_storage.value); - } - BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&)) BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&)) @@ -337,11 +332,6 @@ public: return static_cast< value_type >(operations::fetch_xor(m_storage.value, static_cast< storage_type >(v), order)); } - BOOST_FORCEINLINE bool is_lock_free() const volatile BOOST_NOEXCEPT - { - return operations::is_lock_free(m_storage.value); - } - BOOST_FORCEINLINE value_type operator++(int) volatile BOOST_NOEXCEPT { return fetch_add(1); @@ -476,11 +466,6 @@ public: return compare_exchange_weak(expected, desired, order, atomics::detail::deduce_failure_order(order)); } - BOOST_FORCEINLINE bool is_lock_free() const volatile BOOST_NOEXCEPT - { - return operations::is_lock_free(m_storage.value); - } - BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&)) BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&)) }; @@ -584,11 +569,6 @@ public: return compare_exchange_weak(expected, desired, order, atomics::detail::deduce_failure_order(order)); } - BOOST_FORCEINLINE bool is_lock_free() const volatile BOOST_NOEXCEPT - { - return operations::is_lock_free(m_storage.value); - } - BOOST_FORCEINLINE value_type operator++(int) volatile BOOST_NOEXCEPT { return fetch_add(1); @@ -655,11 +635,17 @@ public: return v; } - BOOST_FORCEINLINE operator value_type() volatile const BOOST_NOEXCEPT + BOOST_FORCEINLINE operator value_type() const volatile BOOST_NOEXCEPT { return this->load(); } + BOOST_FORCEINLINE bool is_lock_free() const volatile BOOST_NOEXCEPT + { + // C++17 requires all instances of atomic<> return a value consistent with is_always_lock_free here + return is_always_lock_free; + } + BOOST_FORCEINLINE storage_type& storage() BOOST_NOEXCEPT { return this->m_storage.value; } BOOST_FORCEINLINE storage_type volatile& storage() volatile BOOST_NOEXCEPT { return this->m_storage.value; } BOOST_FORCEINLINE storage_type const& storage() const BOOST_NOEXCEPT { return this->m_storage.value; } diff --git a/include/boost/atomic/detail/ops_emulated.hpp b/include/boost/atomic/detail/ops_emulated.hpp index a21128e..e15f37a 100644 --- a/include/boost/atomic/detail/ops_emulated.hpp +++ b/include/boost/atomic/detail/ops_emulated.hpp @@ -142,11 +142,6 @@ struct emulated_operations { store(storage, (storage_type)0, order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return false; - } }; template< std::size_t Size, bool Signed > diff --git a/include/boost/atomic/detail/ops_gcc_alpha.hpp b/include/boost/atomic/detail/ops_gcc_alpha.hpp index 15118f5..5a9deb4 100644 --- a/include/boost/atomic/detail/ops_gcc_alpha.hpp +++ b/include/boost/atomic/detail/ops_gcc_alpha.hpp @@ -339,11 +339,6 @@ struct operations< 4u, Signed > : { store(storage, 0, order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; @@ -851,11 +846,6 @@ struct operations< 8u, Signed > : { store(storage, 0, order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; diff --git a/include/boost/atomic/detail/ops_gcc_arm.hpp b/include/boost/atomic/detail/ops_gcc_arm.hpp index e181b16..86a75f5 100644 --- a/include/boost/atomic/detail/ops_gcc_arm.hpp +++ b/include/boost/atomic/detail/ops_gcc_arm.hpp @@ -404,11 +404,6 @@ struct operations< 4u, Signed > : { store(storage, 0, order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; @@ -946,11 +941,6 @@ struct operations< 8u, Signed > : { store(storage, 0, order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; #endif // defined(BOOST_ATOMIC_DETAIL_ARM_HAS_LDREXD_STREXD) diff --git a/include/boost/atomic/detail/ops_gcc_atomic.hpp b/include/boost/atomic/detail/ops_gcc_atomic.hpp index 0a34c01..4e1adae 100644 --- a/include/boost/atomic/detail/ops_gcc_atomic.hpp +++ b/include/boost/atomic/detail/ops_gcc_atomic.hpp @@ -161,11 +161,6 @@ struct gcc_atomic_operations { __atomic_clear(const_cast< storage_type* >(&storage), atomics::detail::convert_memory_order_to_gcc(order)); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile& storage) BOOST_NOEXCEPT - { - return __atomic_is_lock_free(sizeof(storage_type), &storage); - } }; #if BOOST_ATOMIC_INT128_LOCK_FREE > 0 diff --git a/include/boost/atomic/detail/ops_gcc_ppc.hpp b/include/boost/atomic/detail/ops_gcc_ppc.hpp index 4183bc0..76eae4e 100644 --- a/include/boost/atomic/detail/ops_gcc_ppc.hpp +++ b/include/boost/atomic/detail/ops_gcc_ppc.hpp @@ -331,11 +331,6 @@ struct operations< 4u, Signed > : { store(storage, 0, order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; @@ -758,11 +753,6 @@ struct operations< 8u, Signed > : { store(storage, 0, order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; #endif // defined(__powerpc64__) || defined(__PPC64__) diff --git a/include/boost/atomic/detail/ops_gcc_sparc.hpp b/include/boost/atomic/detail/ops_gcc_sparc.hpp index fd42fa8..08492ac 100644 --- a/include/boost/atomic/detail/ops_gcc_sparc.hpp +++ b/include/boost/atomic/detail/ops_gcc_sparc.hpp @@ -120,11 +120,6 @@ struct gcc_sparc_cas32 : fence_after(order); return v; } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; template< bool Signed > @@ -192,11 +187,6 @@ struct gcc_sparc_cas64 : { return compare_exchange_strong(storage, expected, desired, success_order, failure_order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; template< bool Signed > diff --git a/include/boost/atomic/detail/ops_gcc_sync.hpp b/include/boost/atomic/detail/ops_gcc_sync.hpp index 2f41aff..a9a9ae2 100644 --- a/include/boost/atomic/detail/ops_gcc_sync.hpp +++ b/include/boost/atomic/detail/ops_gcc_sync.hpp @@ -145,11 +145,6 @@ struct gcc_sync_operations : if (order == memory_order_seq_cst) __sync_synchronize(); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; #if BOOST_ATOMIC_INT8_LOCK_FREE > 0 diff --git a/include/boost/atomic/detail/ops_gcc_x86.hpp b/include/boost/atomic/detail/ops_gcc_x86.hpp index 98dcdc0..74e45c1 100644 --- a/include/boost/atomic/detail/ops_gcc_x86.hpp +++ b/include/boost/atomic/detail/ops_gcc_x86.hpp @@ -104,11 +104,6 @@ struct gcc_x86_operations : { store(storage, (storage_type)0, order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; template< bool Signed > diff --git a/include/boost/atomic/detail/ops_gcc_x86_dcas.hpp b/include/boost/atomic/detail/ops_gcc_x86_dcas.hpp index e356e8c..7f39621 100644 --- a/include/boost/atomic/detail/ops_gcc_x86_dcas.hpp +++ b/include/boost/atomic/detail/ops_gcc_x86_dcas.hpp @@ -354,11 +354,6 @@ struct gcc_dcas_x86 #endif // defined(__PIC__) #endif } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; #endif // defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B) @@ -611,11 +606,6 @@ struct gcc_dcas_x86_64 return v; #endif } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; #endif // defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B) diff --git a/include/boost/atomic/detail/ops_linux_arm.hpp b/include/boost/atomic/detail/ops_linux_arm.hpp index 01894b6..c26bc2c 100644 --- a/include/boost/atomic/detail/ops_linux_arm.hpp +++ b/include/boost/atomic/detail/ops_linux_arm.hpp @@ -136,11 +136,6 @@ struct linux_arm_cas : return false; } } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; template< bool Signed > diff --git a/include/boost/atomic/detail/ops_msvc_arm.hpp b/include/boost/atomic/detail/ops_msvc_arm.hpp index e0dc09c..e0a709c 100644 --- a/include/boost/atomic/detail/ops_msvc_arm.hpp +++ b/include/boost/atomic/detail/ops_msvc_arm.hpp @@ -124,11 +124,6 @@ struct msvc_arm_operations : { Derived::store(storage, (storage_type)0, order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; template< bool Signed > diff --git a/include/boost/atomic/detail/ops_msvc_x86.hpp b/include/boost/atomic/detail/ops_msvc_x86.hpp index d35396c..6236624 100644 --- a/include/boost/atomic/detail/ops_msvc_x86.hpp +++ b/include/boost/atomic/detail/ops_msvc_x86.hpp @@ -154,11 +154,6 @@ struct msvc_x86_operations : { store(storage, (storage_type)0, order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; template< bool Signed > @@ -799,11 +794,6 @@ struct msvc_dcas_x86 return v; } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; template< bool Signed > @@ -893,11 +883,6 @@ struct msvc_dcas_x86_64 { return compare_exchange_strong(storage, expected, desired, success_order, failure_order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; template< bool Signed > diff --git a/include/boost/atomic/detail/ops_windows.hpp b/include/boost/atomic/detail/ops_windows.hpp index cfeddf1..50d951d 100644 --- a/include/boost/atomic/detail/ops_windows.hpp +++ b/include/boost/atomic/detail/ops_windows.hpp @@ -99,11 +99,6 @@ struct windows_operations : { store(storage, (storage_type)0, order); } - - static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT - { - return true; - } }; template< bool Signed >