From 3e5a5e1c669f6027b897f7358d45f92e1552f746 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 10 Dec 2014 01:29:18 -0500 Subject: Use a triat class for event names instead of having to manually give them places, which is much less error prone --- include/modules/chanserv.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/modules/chanserv.h') diff --git a/include/modules/chanserv.h b/include/modules/chanserv.h index 9985f25dc..a6f741c1b 100644 --- a/include/modules/chanserv.h +++ b/include/modules/chanserv.h @@ -164,7 +164,7 @@ namespace ChanServ */ virtual void OnPreChanExpire(Channel *ci, bool &expire) anope_abstract; }; - static EventHandlersReference OnPreChanExpire("OnPreChanExpire"); + static EventHandlersReference OnPreChanExpire; struct CoreExport ChanExpire : Events { @@ -173,7 +173,7 @@ namespace ChanServ */ virtual void OnChanExpire(Channel *ci) anope_abstract; }; - static EventHandlersReference OnChanExpire("OnChanExpire"); + static EventHandlersReference OnChanExpire; } /* It matters that Base is here before Extensible (it is inherited by Serializable) @@ -734,3 +734,6 @@ namespace ChanServ } }; } + +template<> struct EventName { static constexpr const char *const name = "OnPreChanExpire"; }; +template<> struct EventName { static constexpr const char *const name = "OnChanExpire"; }; -- cgit