diff --git a/rpcs3/util/shared_ptr.hpp b/rpcs3/util/shared_ptr.hpp index 5488cd4cec..6dd1607498 100644 --- a/rpcs3/util/shared_ptr.hpp +++ b/rpcs3/util/shared_ptr.hpp @@ -76,6 +76,8 @@ namespace stx constexpr shared_data() noexcept = default; }; + struct null_ptr_t; + // Simplified unique pointer. In some cases, std::unique_ptr is preferred. // This one is shared_ptr counterpart, it has a control block with refs and deleter. // It's trivially convertible to shared_ptr, and back if refs == 1. @@ -606,6 +608,7 @@ namespace stx || is_instance_of, shared_ptr>::value || is_instance_of, single_ptr>::value || is_instance_of, atomic_ptr>::value; + || std::is_same_v; public: using element_type = std::remove_extent_t; @@ -895,8 +898,6 @@ namespace stx return value; } - [[nodiscard]] shared_type exchange(struct null_ptr_t) noexcept; - // Ineffective [[nodiscard]] bool compare_exchange(shared_type& cmp_and_old, shared_type exch) { @@ -1143,18 +1144,6 @@ namespace stx } } null_ptr; - - template - atomic_ptr::shared_type atomic_ptr::exchange(null_ptr_t) noexcept - { - atomic_ptr old; - old.m_val.raw() = m_val.exchange(0); - old.m_val.raw() += 1; - - shared_type result; - result.m_ptr = std::launder(ptr_to(old.m_val)); - return result; - } } template