diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/Common/AutoPtr.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/CPP/Common/AutoPtr.h b/CPP/Common/AutoPtr.h index 006d315..0be8a7a 100644 --- a/CPP/Common/AutoPtr.h +++ b/CPP/Common/AutoPtr.h | |||
@@ -1,13 +1,13 @@ | |||
1 | // Common/AutoPtr.h | 1 | // Common/AutoPtr.h |
2 | 2 | ||
3 | #ifndef __COMMON_AUTOPTR_H | 3 | #ifndef ZIP7_INC_COMMON_AUTOPTR_H |
4 | #define __COMMON_AUTOPTR_H | 4 | #define ZIP7_INC_COMMON_AUTOPTR_H |
5 | 5 | ||
6 | template<class T> class CMyAutoPtr | 6 | template<class T> class CMyAutoPtr |
7 | { | 7 | { |
8 | T *_p; | 8 | T *_p; |
9 | public: | 9 | public: |
10 | CMyAutoPtr(T *p = 0) : _p(p) {} | 10 | CMyAutoPtr(T *p = NULL) : _p(p) {} |
11 | CMyAutoPtr(CMyAutoPtr<T>& p): _p(p.release()) {} | 11 | CMyAutoPtr(CMyAutoPtr<T>& p): _p(p.release()) {} |
12 | CMyAutoPtr<T>& operator=(CMyAutoPtr<T>& p) | 12 | CMyAutoPtr<T>& operator=(CMyAutoPtr<T>& p) |
13 | { | 13 | { |
@@ -21,10 +21,10 @@ public: | |||
21 | T* release() | 21 | T* release() |
22 | { | 22 | { |
23 | T *tmp = _p; | 23 | T *tmp = _p; |
24 | _p = 0; | 24 | _p = NULL; |
25 | return tmp; | 25 | return tmp; |
26 | } | 26 | } |
27 | void reset(T* p = 0) | 27 | void reset(T* p = NULL) |
28 | { | 28 | { |
29 | if (p != _p) | 29 | if (p != _p) |
30 | delete _p; | 30 | delete _p; |