From 601ddbbb2590079f86772e2b12301d78c8a4c0c2 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 30 Jan 2021 19:53:36 +0000 Subject: Replace defaultdeleter with the C++11 one and rename culldeleter. --- include/extensible.h | 2 +- include/inspircd.h | 2 +- include/stdalgo.h | 16 ++-------------- 3 files changed, 4 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/extensible.h b/include/extensible.h index 4a9c980ca..94f3e7c28 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -185,7 +185,7 @@ class CoreExport ExtensionManager }; /** Represents a simple ExtensionItem. */ -template > +template > class SimpleExtItem : public ExtensionItem { public: diff --git a/include/inspircd.h b/include/inspircd.h index 30f4d3a3a..d3ddee776 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -564,7 +564,7 @@ class CoreExport InspIRCd ENTRYPOINT; -inline void stdalgo::culldeleter::operator()(classbase* item) +inline void stdalgo::cull_delete::operator()(classbase* item) { if (item) ServerInstance->GlobalCulls.AddItem(item); diff --git a/include/stdalgo.h b/include/stdalgo.h index abf7fab46..cf267798b 100644 --- a/include/stdalgo.h +++ b/include/stdalgo.h @@ -151,23 +151,11 @@ namespace stdalgo } } - /** - * Deleter that uses operator delete to delete the item - */ - template - struct defaultdeleter - { - void operator()(T* o) - { - delete o; - } - }; - /** * Deleter that adds the item to the cull list, that is, queues it for * deletion at the end of the current mainloop iteration */ - struct culldeleter + struct cull_delete { void operator()(classbase* item); }; @@ -179,7 +167,7 @@ namespace stdalgo template class Cont, typename T, typename Alloc> inline void delete_all(const Cont& cont) { - std::for_each(cont.begin(), cont.end(), defaultdeleter()); + std::for_each(cont.begin(), cont.end(), std::default_delete()); } /** Deletes a object and zeroes the memory location that pointed to it. -- cgit v1.3.1-10-gc9f91