#ifndef _AUTOCONTAINER_H #define _AUTOCONTAINER_H #include #include using namespace std; template struct DeleteObj : std::unary_function { T operator()(const T& x) const {delete x; return 0;} }; template struct AutoContainer : public Container { ~AutoContainer() //{for_each(rbegin(),rend(),DeleteObj());} {transform(rbegin(),rend(),rbegin(),DeleteObj());} }; #endif