]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add the fakederef class
authorAttila Molnar <attilamolnar@hush.com>
Tue, 24 Jun 2014 10:08:20 +0000 (12:08 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Tue, 24 Jun 2014 10:08:20 +0000 (12:08 +0200)
include/inspircd.h

index dab00d31cf9492e04f173e3d27f187378ea57e42..4850d5a0347febb02c17e0b83c05d5b6adb47bdd 100644 (file)
 
 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"