Browse Source

vlc_arrays: Adding a C++ helper to clean a container

Signed-off-by: Rémi Duraffort <ivoire@videolan.org>
pull/2/head
Hugo Beauzée-Luyssen 16 years ago
committed by Rémi Duraffort
parent
commit
a1a0cafb6c
  1. 16
      include/vlc_arrays.h

16
include/vlc_arrays.h

@ -617,4 +617,20 @@ vlc_dictionary_remove_value_for_key( const vlc_dictionary_t * p_dict, const char
/* No key was found */
}
#ifdef __cplusplus
// C++ helpers
template <typename T>
void vlc_delete_all( T &container )
{
typename T::iterator it = container.begin();
while ( it != container.end() )
{
delete *it;
++it;
}
container.clear();
}
#endif
#endif

Loading…
Cancel
Save