#ifndef __clone_ptr__
#define __clone_ptr__

template <typename Class> 
class clone_ptr {
public:
  Class * ptr;
  bool    own;
  clone_ptr() : ptr(0), own(true) {}
  clone_ptr(Class * p, bool o = true) : ptr(p), own(o) {}
  clone_ptr(const clone_ptr & other);
  clone_ptr & operator= (const clone_ptr & other);
  Class & operator*  () const {return *ptr;}
  Class * operator-> () const {return ptr;}
  operator bool () const {return ptr;}
  ~clone_ptr();
};

#endif

