|
@@ -63,23 +63,23 @@ public:
|
|
|
}
|
|
|
|
|
|
template<typename U>
|
|
|
- ALWAYS_INLINE RefPtr(NonnullRefPtr<U> const& other)
|
|
|
requires(IsConvertible<U*, T*>)
|
|
|
+ ALWAYS_INLINE RefPtr(NonnullRefPtr<U> const& other)
|
|
|
: m_ptr(const_cast<T*>(static_cast<T const*>(other.ptr())))
|
|
|
{
|
|
|
m_ptr->ref();
|
|
|
}
|
|
|
|
|
|
template<typename U>
|
|
|
- ALWAYS_INLINE RefPtr(NonnullRefPtr<U>&& other)
|
|
|
requires(IsConvertible<U*, T*>)
|
|
|
+ ALWAYS_INLINE RefPtr(NonnullRefPtr<U>&& other)
|
|
|
: m_ptr(static_cast<T*>(&other.leak_ref()))
|
|
|
{
|
|
|
}
|
|
|
|
|
|
template<typename U>
|
|
|
- RefPtr(RefPtr<U>&& other)
|
|
|
requires(IsConvertible<U*, T*>)
|
|
|
+ RefPtr(RefPtr<U>&& other)
|
|
|
: m_ptr(static_cast<T*>(other.leak_ref()))
|
|
|
{
|
|
|
}
|
|
@@ -131,8 +131,8 @@ public:
|
|
|
}
|
|
|
|
|
|
template<typename U>
|
|
|
- ALWAYS_INLINE RefPtr& operator=(RefPtr<U>&& other)
|
|
|
requires(IsConvertible<U*, T*>)
|
|
|
+ ALWAYS_INLINE RefPtr& operator=(RefPtr<U>&& other)
|
|
|
{
|
|
|
RefPtr tmp { move(other) };
|
|
|
swap(tmp);
|
|
@@ -140,8 +140,8 @@ public:
|
|
|
}
|
|
|
|
|
|
template<typename U>
|
|
|
- ALWAYS_INLINE RefPtr& operator=(NonnullRefPtr<U>&& other)
|
|
|
requires(IsConvertible<U*, T*>)
|
|
|
+ ALWAYS_INLINE RefPtr& operator=(NonnullRefPtr<U>&& other)
|
|
|
{
|
|
|
RefPtr tmp { move(other) };
|
|
|
swap(tmp);
|
|
@@ -156,8 +156,8 @@ public:
|
|
|
}
|
|
|
|
|
|
template<typename U>
|
|
|
- ALWAYS_INLINE RefPtr& operator=(NonnullRefPtr<U> const& other)
|
|
|
requires(IsConvertible<U*, T*>)
|
|
|
+ ALWAYS_INLINE RefPtr& operator=(NonnullRefPtr<U> const& other)
|
|
|
{
|
|
|
RefPtr tmp { other };
|
|
|
swap(tmp);
|
|
@@ -172,8 +172,8 @@ public:
|
|
|
}
|
|
|
|
|
|
template<typename U>
|
|
|
- ALWAYS_INLINE RefPtr& operator=(RefPtr<U> const& other)
|
|
|
requires(IsConvertible<U*, T*>)
|
|
|
+ ALWAYS_INLINE RefPtr& operator=(RefPtr<U> const& other)
|
|
|
{
|
|
|
RefPtr tmp { other };
|
|
|
swap(tmp);
|
|
@@ -261,8 +261,8 @@ public:
|
|
|
bool operator==(NonnullRefPtr<U> const& other) const { return as_ptr() == other.m_ptr; }
|
|
|
|
|
|
template<typename RawPtr>
|
|
|
- bool operator==(RawPtr other) const
|
|
|
requires(IsPointer<RawPtr>)
|
|
|
+ bool operator==(RawPtr other) const
|
|
|
{
|
|
|
return as_ptr() == other;
|
|
|
}
|
|
@@ -313,8 +313,8 @@ inline RefPtr<T> static_ptr_cast(RefPtr<U> const& ptr)
|
|
|
}
|
|
|
|
|
|
template<typename T, typename U>
|
|
|
-inline void swap(RefPtr<T>& a, RefPtr<U>& b)
|
|
|
requires(IsConvertible<U*, T*>)
|
|
|
+inline void swap(RefPtr<T>& a, RefPtr<U>& b)
|
|
|
{
|
|
|
a.swap(b);
|
|
|
}
|