Browse Source

casting for unique pointers

Kajetan Johannes Hammerle 3 years ago
parent
commit
9df4fa0b0f
1 changed files with 8 additions and 0 deletions
  1. 8 0
      memory/UniquePointer.h

+ 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