/trunk/Examples/python/smartptr/smartptr.h
C++ Header | 13 lines | 12 code | 1 blank | 0 comment | 0 complexity | 65f291177990921a7e65c7b5c012f351 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- template<class T> class SmartPtr {
- public:
- SmartPtr(T *realPtr = 0) { pointee = realPtr; }
- T *operator->() const {
- return pointee;
- }
- T &operator*() const {
- return *pointee;
- }
- private:
- T *pointee;
- };