summaryrefslogtreecommitdiff
path: root/src/common/nullpo.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/nullpo.hpp')
-rw-r--r--src/common/nullpo.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/nullpo.hpp b/src/common/nullpo.hpp
index 305448f..9eb9ea9 100644
--- a/src/common/nullpo.hpp
+++ b/src/common/nullpo.hpp
@@ -27,4 +27,15 @@
bool nullpo_chk(const char *file, int line, const char *func,
const void *target);
+template<class T>
+bool nullpo_chk(const char *file, int line, const char *func, T target)
+{
+ return nullpo_chk(file, line, func, target.operator->());
+}
+template<class T>
+bool nullpo_chk(const char *file, int line, const char *func, T *target)
+{
+ return nullpo_chk(file, line, func, static_cast<const void *>(target));
+}
+
#endif // NULLPO_HPP