--- rxvt-unicode/src/rxvtutil.h 2014/10/23 22:39:40 1.59 +++ rxvt-unicode/src/rxvtutil.h 2014/11/12 12:12:02 1.62 @@ -1,7 +1,6 @@ #ifndef RXVT_UTIL_H #define RXVT_UTIL_H -#include #include #include #include "ecb.h" @@ -89,80 +88,7 @@ }; #endif -inline void * -operator new (size_t size) throw (std::bad_alloc) -{ - // TODO: use rxvt_malloc - return malloc (size); -} - -inline void -operator delete (void *p) throw () -{ - free (p); -} - -template -struct auto_ptr -{ - T *p; - - auto_ptr () : p (0) { } - - explicit - auto_ptr (T *a) : p (a) { } - - auto_ptr (auto_ptr &a) - { - p = a.p; - a.p = 0; - } - - template - auto_ptr (auto_ptr &a) - { - p = a.p; - a.p = 0; - } - - ~auto_ptr () - { - delete p; - } - - void reset (T *a) - { - delete p; - p = a; - } - - // void because it makes sense in our context - void operator =(auto_ptr &a) - { - reset (a.release ()); - } - - template - void operator =(auto_ptr &a) - { - reset (a.release ()); - } - - T *operator ->() const { return p; } - T &operator *() const { return *p; } - - operator T *() { return p; } - T *get () const { return p; } - - T *release() - { - T *r = p; - p = 0; - return r; - } -}; - -typedef auto_ptr auto_str; +typedef estl::scoped_array auto_str; #endif