mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 17:11:23 +00:00
shared_ptr.hpp: add invoke operator
This commit is contained in:
parent
7197dd751a
commit
e34c956196
@ -258,6 +258,12 @@ namespace stx
|
||||
}
|
||||
}
|
||||
|
||||
template <typename... Args> requires (std::is_invocable_v<T, Args&&...>)
|
||||
decltype(auto) operator()(Args&&... args) const noexcept
|
||||
{
|
||||
return std::invoke(*m_ptr, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
operator element_type*() const noexcept
|
||||
{
|
||||
return m_ptr;
|
||||
@ -583,6 +589,12 @@ namespace stx
|
||||
}
|
||||
}
|
||||
|
||||
template <typename... Args> requires (std::is_invocable_v<T, Args&&...>)
|
||||
decltype(auto) operator()(Args&&... args) const noexcept
|
||||
{
|
||||
return std::invoke(*m_ptr, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
usz use_count() const noexcept
|
||||
{
|
||||
if (m_ptr)
|
||||
|
Loading…
Reference in New Issue
Block a user