From 7eb08aafeff2afe669709ab8c133dc0acb68664a Mon Sep 17 00:00:00 2001 From: tihmstar Date: Thu, 22 Sep 2016 00:43:49 +0200 Subject: [PATCH] changed pointer casting --- futurerestore/futurerestore.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/futurerestore/futurerestore.hpp b/futurerestore/futurerestore.hpp index 4b3857fc..005461c4 100644 --- a/futurerestore/futurerestore.hpp +++ b/futurerestore/futurerestore.hpp @@ -22,8 +22,8 @@ class ptr_smart { public: T _p; ptr_smart(T p, function ptr_free){static_assert(is_pointer(), "error: this is for pointers only\n"); _p = p;_ptr_free = ptr_free;} - ptr_smart(T p){this->ptr_smart(p,static_cast(free));} - ptr_smart(){this->ptr_smart(NULL,static_cast(free));} + ptr_smart(T p){ptr_smart(p,reinterpret_cast(free));} + ptr_smart(){ptr_smart(NULL,reinterpret_cast(free));} T operator=(T p){return _p = p;} T *operator&(){return &_p;} ~ptr_smart(){if (_p) _ptr_free(_p);}