/* pointer.tcc -- implement P source file of the Flower Library (c) 1997--1998 Han-Wen Nienhuys */ #ifndef POINTER_TCC #define POINTER_TCC template inline T * P::copy_p() const { return t_p? new T(*t_p) : 0; } template inline void P::copy (T const *l_C) { t_p = l_C ? new T(*l_C) : 0; } template inline void P::junk() { delete t_p; t_p =0; } template inline P::P(P const &s) { t_p = s.copy_p(); } template inline P & P::operator =(P const&s) { junk(); copy (s.t_p); return *this; } template inline P::~P() { junk(); } template inline void P::set_p (T * np) { if (np == t_p) return; delete t_p; t_p = np; } template inline void P::set_l (T const * l_C) { if (t_p == l_C) return; junk(); copy (l_C); } #endif // POINTER_TCC