summaryrefslogtreecommitdiff
path: root/include/inspircd.h
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-24 12:08:20 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-24 12:08:20 +0200
commit3a921efb0bd049eb8cccfcc205ebb260c78b423a (patch)
treed2e7c4cf98d7899f4cc4a9e7de5b18da03ac4581 /include/inspircd.h
parent5043a2f83598baa3afba53201f690e6deac3eafd (diff)
Add the fakederef class
Diffstat (limited to 'include/inspircd.h')
-rw-r--r--include/inspircd.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index dab00d31c..4850d5a03 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -50,6 +50,17 @@
CoreExport extern InspIRCd* ServerInstance;
+/** Base class for manager classes that are still accessed using -> but are no longer pointers
+ */
+template <typename T>
+struct fakederef
+{
+ T* operator->()
+ {
+ return static_cast<T*>(this);
+ }
+};
+
#include "config.h"
#include "dynref.h"
#include "consolecolors.h"