Index: core/fxcrt/include/fx_memory.h |
diff --git a/core/fxcrt/include/fx_memory.h b/core/fxcrt/include/fx_memory.h |
index fa8da6067c53d0cb6a5fd4f7fcbffbde8b3b581d..53e6b9d1eb61a118afe8867e915cf4b48eed2199 100644 |
--- a/core/fxcrt/include/fx_memory.h |
+++ b/core/fxcrt/include/fx_memory.h |
@@ -23,6 +23,7 @@ void FXMEM_DefaultFree(void* pointer, int flags); |
#include <stdlib.h> |
#include <limits> |
+#include <memory> |
#include <new> |
NEVER_INLINE void FX_OutOfMemoryTerminate(); |
@@ -100,6 +101,12 @@ struct ReleaseDeleter { |
inline void operator()(T* ptr) const { ptr->Release(); } |
}; |
+// Used to help transfer ownership of a raw pointer to std::unique_ptr. |
+template <typename T> |
+std::unique_ptr<T> WrapUnique(T* ptr) { |
+ return std::unique_ptr<T>(ptr); |
+} |
+ |
class CFX_Deletable { |
public: |
virtual ~CFX_Deletable() {} |