Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Side by Side Diff: third_party/lzma/v4_65/files/CPP/Common/AutoPtr.h

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Common/AutoPtr.h
2
3 #ifndef __COMMON_AUTOPTR_H
4 #define __COMMON_AUTOPTR_H
5
6 template<class T> class CMyAutoPtr
7 {
8 T *_p;
9 public:
10 CMyAutoPtr(T *p = 0) : _p(p) {}
11 CMyAutoPtr(CMyAutoPtr<T>& p): _p(p.release()) {}
12 CMyAutoPtr<T>& operator=(CMyAutoPtr<T>& p)
13 {
14 reset(p.release());
15 return (*this);
16 }
17 ~CMyAutoPtr() { delete _p; }
18 T& operator*() const { return *_p; }
19 // T* operator->() const { return (&**this); }
20 T* get() const { return _p; }
21 T* release()
22 {
23 T *tmp = _p;
24 _p = 0;
25 return tmp;
26 }
27 void reset(T* p = 0)
28 {
29 if (p != _p)
30 delete _p;
31 _p = p;
32 }
33 };
34
35 #endif
OLDNEW
« no previous file with comments | « third_party/lzma/v4_65/files/CPP/Build.mak ('k') | third_party/lzma/v4_65/files/CPP/Common/Buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698