00001 #ifndef DELETE_OBJECTS_H 00002 #define DELETE_OBJECTS_H 00003 00013 #include <algorithm> 00014 00015 00019 struct DeleteObjects { 00025 template<typename T> void operator()(const T* ptr) const { 00026 if (ptr) { 00027 delete ptr; 00028 ptr = NULL; 00029 } 00030 } 00031 }; 00032 00033 #endif /* !DELETE_OBJECTS_H */ 00034