Use void* as return type of get_address()
This commit is contained in:
parent
d0425d2c57
commit
55127d0c31
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue