diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-05-25 13:49:50 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-05-25 13:49:50 -0700 |
commit | 1d0e18a186f67844ccd873eabb56ebdaa3f47f11 (patch) | |
tree | 94199c6dbcb6b4a86584c303f6e1e72073873f01 /src/common/nullpo.hpp | |
parent | 87218e07b2bc89593eae1cb4abe859cd1a7eaa0f (diff) | |
download | tmwa-1d0e18a186f67844ccd873eabb56ebdaa3f47f11.tar.gz tmwa-1d0e18a186f67844ccd873eabb56ebdaa3f47f11.tar.bz2 tmwa-1d0e18a186f67844ccd873eabb56ebdaa3f47f11.tar.xz tmwa-1d0e18a186f67844ccd873eabb56ebdaa3f47f11.zip |
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 ...
Diffstat (limited to 'src/common/nullpo.hpp')
-rw-r--r-- | src/common/nullpo.hpp | 11 |
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 |