OwnedPtr, SharedPtr: Add operator bool
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
ae22321648
commit
e9e1bef89c
@ -59,6 +59,11 @@ template <typename T> class OwnedPtr
|
||||
return *m_ptr;
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return m_ptr != nullptr;
|
||||
}
|
||||
|
||||
template <typename Type> friend Result<SharedPtr<Type>> adopt_shared_from_owned(OwnedPtr<Type>&&);
|
||||
|
||||
private:
|
||||
|
@ -99,6 +99,11 @@ template <typename T> class SharedPtr
|
||||
return *m_ptr;
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return m_ptr != nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
T* m_ptr;
|
||||
RefCount* m_ref_count;
|
||||
|
Loading…
Reference in New Issue
Block a user