Commit a1a0cafb authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Rémi Duraffort

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

Signed-off-by: default avatarRémi Duraffort <ivoire@videolan.org>
parent 4cb95a42
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment