diff options
Diffstat (limited to 'include/m_system_cpp.h')
-rw-r--r-- | include/m_system_cpp.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h index a04898e427..9d872480e9 100644 --- a/include/m_system_cpp.h +++ b/include/m_system_cpp.h @@ -38,6 +38,17 @@ extern LIST_INTERFACE li; #define HandleKeySortT -2
#define PtrKeySortT -3
+template<class T> class mir_ptr
+{
+ T* data;
+
+public:
+ __inline mir_ptr(T* _p) : data(_p) {}
+ __inline ~mir_ptr() { mir_free(data); }
+ __inline operator T*() const { return data; }
+ __inline operator INT_PTR() const { return (INT_PTR)data; }
+};
+
template<class T> struct LIST
{
typedef int (*FTSortFunc)(const T* p1, const T* p2);
|