From 1d0e18a186f67844ccd873eabb56ebdaa3f47f11 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 25 May 2013 13:49:50 -0700 Subject: Switch block_list and subclasses to dumb_ptr Now we're well-defined, since we're actually calling ctors and dtors. Most of this code will not survive long ... --- src/common/nullpo.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/common/nullpo.hpp') 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 +bool nullpo_chk(const char *file, int line, const char *func, T target) +{ + return nullpo_chk(file, line, func, target.operator->()); +} +template +bool nullpo_chk(const char *file, int line, const char *func, T *target) +{ + return nullpo_chk(file, line, func, static_cast(target)); +} + #endif // NULLPO_HPP -- cgit v1.2.3-60-g2f50