2 pointer.hh -- declare P
4 source file of the Flower Library
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
13 /** P<T> is a handy template to use iso T*. It inits to 0, deletes on
14 destruction, deep copies upon copying
16 It is probably not feasible to use P<T> as template argument, since
17 a lot of auto conversion wouldn't work. new T would be called too
20 Sorry for the silly naming */
31 T *get_p() { T*p = t_p; t_p=0; return p; }
32 T *get_l() { return t_p; }
34 void set_p (T *new_p);
37 P &operator =(P const &);
40 //P(T *p) { t_p = p; }
42 T *operator ->() { return t_p; }
43 operator T * () { return t_p; }
44 const T *operator ->() const { return t_p ; }
45 operator const T *() const { return t_p; }