Эх сурвалжийг харах

casting for unique pointers

Kajetan Johannes Hammerle 3 жил өмнө
parent
commit
9df4fa0b0f

+ 8 - 0
memory/UniquePointer.h

@@ -39,6 +39,14 @@ public:
     const T* operator->() const {
         return t;
     }
+
+    operator T*() {
+        return t;
+    }
+
+    operator const T*() const {
+        return t;
+    }
 };
 
 #endif