最简单的直接测试
1 |
|
从数组中获取地址并调用
1 |
|
获取类成员函数地址并调用$^{1}$
1 |
|
对应的函数模板与使用方法
getAddress
1 | template<typename dst_type, typename src_type> |
1 | long address = (long)getAddress<void*>(&FuncFlowT::funcA); |
callFunc
1 | template<typename src_type> |
1 | callFunc<long>(address); |
1 | #include <iostream> |
1 | #include <iostream> |
1 | #include <iostream> |
1 | template<typename dst_type, typename src_type> |
1 | long address = (long)getAddress<void*>(&FuncFlowT::funcA); |
1 | template<typename src_type> |
1 | callFunc<long>(address); |