Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __UT_STD_VECTOR_H__
00024 #define __UT_STD_VECTOR_H__
00025
00026 #include "ut_assert.h"
00027
00028
00029 template <class V>
00030 void UT_std_vector_sparsepurgeall(V & v)
00031 {
00032 for(typename V::iterator iter = v.begin();iter != v.end(); ++iter) {
00033 if(*iter) {
00034 delete *iter;
00035 }
00036 }
00037 }
00038
00039 template <class V>
00040 void UT_std_vector_purgeall(V & v)
00041 {
00042 for(typename V::iterator iter = v.begin();iter != v.end(); ++iter) {
00043 UT_ASSERT_HARMLESS(*iter);
00044 if(*iter) {
00045 delete *iter;
00046 }
00047 }
00048 }
00049
00050 template <class V, typename F>
00051 void UT_std_vector_freeall(V & v, F free_func = g_free)
00052 {
00053 for(typename V::iterator iter = v.begin();iter != v.end(); ++iter) {
00054 if(*iter) {
00055 free_func(*iter);
00056 }
00057 }
00058 }
00059
00060 #endif