--- rxvt-unicode/src/rxvtvec.h 2003/11/24 19:52:16 1.2 +++ rxvt-unicode/src/rxvtvec.h 2003/11/25 11:52:42 1.3 @@ -7,6 +7,8 @@ #include #include "simplevec.h" +#include + #if 0 template struct rxvt_vec : simplevec { @@ -39,6 +41,12 @@ auto_ptr() : p(0) { } auto_ptr(T *a) : p(a) { } + auto_ptr(auto_ptr &a) + { + p = a.p; + a.p = 0; + } + template auto_ptr(auto_ptr &a) { @@ -46,6 +54,11 @@ a.p = 0; } + ~auto_ptr() + { + delete p; + } + // void because it makes sense in our context void operator =(T *a) { @@ -53,6 +66,12 @@ p = a; } + void operator =(auto_ptr &a) + { + *this = a.p; + a.p = 0; + } + template void operator =(auto_ptr &a) { @@ -75,4 +94,14 @@ typedef auto_ptr auto_str; +struct stringvec : simplevec +{ + ~stringvec () + { + for (char **c = begin(); c != end(); c++) + delete [] *c; + } +}; + #endif +