mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
Add g_fxo->init_crtp to simplify thread construction
This commit is contained in:
parent
7eebe06931
commit
fa02a04baa
3 changed files with 14 additions and 11 deletions
|
|
@ -165,6 +165,14 @@ namespace stx
|
|||
return obj;
|
||||
}
|
||||
|
||||
// Special stuff
|
||||
template <template <class...> typename CTAD, typename... Args>
|
||||
auto init_crtp(Args&&... args) noexcept
|
||||
{
|
||||
using T = decltype(CTAD{std::forward<Args>(args)...});
|
||||
return init<T>(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
// Obtain object pointer (the only thread safe function)
|
||||
template <typename T>
|
||||
T* get() const noexcept
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue