ソースを参照

LibJS: Allow constructing a Handle<T> from a {Nonnull,}GCPtr<T>

Matthew Olsson 2 年 前
コミット
1df3652e27
1 ファイル変更10 行追加0 行削除
  1. 10 0
      Userland/Libraries/LibJS/Heap/Handle.h

+ 10 - 0
Userland/Libraries/LibJS/Heap/Handle.h

@@ -60,6 +60,16 @@ public:
     {
     }
 
+    Handle(GCPtr<T> cell)
+        : Handle(cell.ptr())
+    {
+    }
+
+    Handle(NonnullGCPtr<T> cell)
+        : Handle(*cell)
+    {
+    }
+
     T* cell() const
     {
         if (!m_impl)