代码输出0而不是地址 std :: function :: target虽然使用bool(AAA :: *)类型(uint32_t,uint64_t,uint32_t),但仍无法获得成员函数
#include <functional>
#include <iostream>
#include <typeinfo>
typedef std::function<bool (uint32_t , uint64_t , uint32_t )> CheckHandler;
struct AAA {
bool IsShouldWrite (uint32_t log_id, uint64_t uid, uint32_t priority) {}
};
int main() {
AAA a;
CheckHandler check_handler =std::bind(&AAA::IsShouldWrite, &a, std::placeholders::_1,std::placeholders::_2,std::placeholders::_3);
std::cout<<check_handler.target<bool (AAA::*)(uint32_t , uint64_t , uint32_t )>();
}