mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 19:28:43 +12:00
shared_ptr.hpp: add invoke operator
This commit is contained in:
parent
7197dd751a
commit
e34c956196
1 changed files with 12 additions and 0 deletions
|
@ -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
|
operator element_type*() const noexcept
|
||||||
{
|
{
|
||||||
return m_ptr;
|
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
|
usz use_count() const noexcept
|
||||||
{
|
{
|
||||||
if (m_ptr)
|
if (m_ptr)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue