diff --git a/rpcs3/util/shared_ptr.hpp b/rpcs3/util/shared_ptr.hpp index 109e28216a..138599d107 100644 --- a/rpcs3/util/shared_ptr.hpp +++ b/rpcs3/util/shared_ptr.hpp @@ -598,7 +598,7 @@ namespace stx constexpr atomic_ptr() noexcept = default; // Optimized value construct - template >> + template requires (!(sizeof...(Args) == 1 && (std::is_same_v, shared_type> || ...)) && std::is_constructible_v) explicit atomic_ptr(Args&&... args) noexcept { shared_type r = make_single(std::forward(args)...); @@ -805,7 +805,9 @@ namespace stx } } - template >> + // Create an object from variadic args + // If a type needs shared_type to be constructed, std::reference_wrapper can be used + template requires (!(sizeof...(Args) == 1 && (std::is_same_v, shared_type> || ...)) && std::is_constructible_v) void store(Args&&... args) noexcept { shared_type r = make_single(std::forward(args)...); @@ -827,7 +829,7 @@ namespace stx old.m_val.raw() = m_val.exchange(reinterpret_cast(std::exchange(value.m_ptr, nullptr)) << c_ref_size); } - template >> + template requires (!(sizeof...(Args) == 1 && (std::is_same_v, shared_type> || ...)) && std::is_constructible_v) [[nodiscard]] shared_type exchange(Args&&... args) noexcept { shared_type r = make_single(std::forward(args)...);