Use void* as return type of get_address()

This commit is contained in:
Christophe Bedard 2019-06-17 11:41:42 +02:00
parent d0425d2c57
commit 55127d0c31

View file

@ -5,7 +5,7 @@
#include <functional> #include <functional>
template<typename T, typename ... U> template<typename T, typename ... U>
size_t get_address(std::function<T(U...)> f) void * get_address(std::function<T(U...)> f)
{ {
typedef T (fnType)(U...); typedef T (fnType)(U...);
fnType ** fnPointer = f.template target<fnType *>(); fnType ** fnPointer = f.template target<fnType *>();
@ -13,7 +13,7 @@ size_t get_address(std::function<T(U...)> f)
if (fnPointer == nullptr) { if (fnPointer == nullptr) {
return 0; return 0;
} }
return (size_t)*fnPointer; return (void *)*fnPointer;
} }
const char * get_symbol(void * funptr); const char * get_symbol(void * funptr);