From e34c956196abe12afdd141028beca51385c1656b Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 24 Apr 2021 13:48:46 +0300 Subject: [PATCH] shared_ptr.hpp: add invoke operator --- rpcs3/util/shared_ptr.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rpcs3/util/shared_ptr.hpp b/rpcs3/util/shared_ptr.hpp index 91c0a44b11..420f15efc9 100644 --- a/rpcs3/util/shared_ptr.hpp +++ b/rpcs3/util/shared_ptr.hpp @@ -258,6 +258,12 @@ namespace stx } } + template requires (std::is_invocable_v) + decltype(auto) operator()(Args&&... args) const noexcept + { + return std::invoke(*m_ptr, std::forward(args)...); + } + operator element_type*() const noexcept { return m_ptr; @@ -583,6 +589,12 @@ namespace stx } } + template requires (std::is_invocable_v) + decltype(auto) operator()(Args&&... args) const noexcept + { + return std::invoke(*m_ptr, std::forward(args)...); + } + usz use_count() const noexcept { if (m_ptr)