mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +00:00
[orbis-kernel] rc: add cast utilities
This commit is contained in:
parent
8e376c465e
commit
60c3077cd6
1 changed files with 7 additions and 0 deletions
|
|
@ -124,6 +124,13 @@ public:
|
|||
bool operator==(std::nullptr_t) const { return m_ref == nullptr; }
|
||||
auto operator<=>(const T *other) const { return m_ref <=> other; }
|
||||
auto operator<=>(const Ref &other) const = default;
|
||||
|
||||
template <typename OtherT> Ref<OtherT> cast() {
|
||||
return Ref<OtherT>(dynamic_cast<OtherT *>(m_ref));
|
||||
}
|
||||
template <typename OtherT> Ref<OtherT> staticCast() {
|
||||
return Ref<OtherT>(static_cast<OtherT *>(m_ref));
|
||||
}
|
||||
};
|
||||
|
||||
// template <WithRc T, typename... ArgsT>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue