swig/Examples/python/smartptr/smartptr.h

14 lines
231 B
C++

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;
};