PageRenderTime 42ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/ttn-post-libtool-1-4-3-upgrade/SWIG/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
  1. template<class T> class SmartPtr {
  2. public:
  3. SmartPtr(T *realPtr = 0) { pointee = realPtr; }
  4. T *operator->() const {
  5. return pointee;
  6. }
  7. T &operator*() const {
  8. return *pointee;
  9. }
  10. private:
  11. T *pointee;
  12. };