00001 //=================================================================================================// 00002 // filename: RmStlUtil.h // 00003 // // 00004 // ATI Research, Inc. // 00005 // 3D Application Research Group // 00006 // // 00007 // Description: StlUtil Class for RenderMonkey. // 00008 // // 00009 //=================================================================================================// 00010 // (C) 2004 ATI Research, Inc. All rights reserved. // 00011 //=================================================================================================// 00012 00013 #ifndef _RM_CORE_STL_UTIL_H_ 00014 #define _RM_CORE_STL_UTIL_H_ 00015 00016 #include <Core/RmTypes.h> 00017 00018 // Necessary to get rid of Visual Studio 6.0 compiler warnings about long templatized instances names 00019 #pragma warning ( disable: 4786 ) 00020 00021 //============================================================================================== 00022 // Deletion of STL List's items 00023 // 00024 // - T is data structure ( list, vector, etc of STL ) of pointer 00025 // 00026 // Eg std::list<MyStruct*> 00027 //============================================================================================== 00028 template <class T> 00029 void RmCleanupSTLContainer( T &myList ) 00030 { 00031 T::iterator itr = myList.begin(); 00032 while (itr!=myList.end()) 00033 { 00034 delete (*itr); 00035 itr = myList.erase(itr); 00036 } // End while 00037 }; // End of RmCleanupSTLContainer 00038 00039 #endif
1.3.6