#include "refptr.h" template refptr::refptr(const T * ptr) { m_ptr = ptr; refCount = new int; *refCount = 1; } template refptr::refptr(const refptr & orig) { cloneFrom(orig); } template refptr & refptr::operator=(const refptr & orig) { cloneFrom(orig); return *this; } template void refptr::cloneFrom(const refptr & orig) { this->ptr = orig.ptr; this->refCount = orig.refCount; (*refCount)++; }