mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:37:44 +00:00
LibJS: Allow constructing a GCPtr from another GCPtr of convertible type
This commit is contained in:
parent
93a5a54927
commit
5094dcf615
1 changed files with 12 additions and 1 deletions
|
@ -100,6 +100,18 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GCPtr(GCPtr<T> const& other)
|
||||||
|
: m_ptr(other.ptr())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename U>
|
||||||
|
GCPtr(GCPtr<U> const& other)
|
||||||
|
requires(IsConvertible<U*, T*>)
|
||||||
|
: m_ptr(other.ptr())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
GCPtr(NonnullGCPtr<T> const& other)
|
GCPtr(NonnullGCPtr<T> const& other)
|
||||||
: m_ptr(other.ptr())
|
: m_ptr(other.ptr())
|
||||||
{
|
{
|
||||||
|
@ -117,7 +129,6 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GCPtr(GCPtr const&) = default;
|
|
||||||
GCPtr& operator=(GCPtr const&) = default;
|
GCPtr& operator=(GCPtr const&) = default;
|
||||||
|
|
||||||
template<typename U>
|
template<typename U>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue