X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fstdalgo.h;h=afbd763fb259eca74f9543afdf75f68b17361005;hb=b512f1b9667ca0479d42e771082f3bc8d92c63a2;hp=1ae5b8ae1098919779a4414b47ba343651750af6;hpb=facea197311f9dfbd9401b32b18cfd1245ff9be4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/stdalgo.h b/include/stdalgo.h index 1ae5b8ae1..afbd763fb 100644 --- a/include/stdalgo.h +++ b/include/stdalgo.h @@ -84,4 +84,14 @@ namespace stdalgo { void operator()(classbase* item); }; + + /** + * Deletes all elements in a container using operator delete + * @param cont The container containing the elements to delete + */ + template class Cont, typename T, typename Alloc> + inline void delete_all(const Cont& cont) + { + std::for_each(cont.begin(), cont.end(), defaultdeleter()); + } }