Check if a class has a member function of a given signature

后端 未结 17 1481
無奈伤痛
無奈伤痛 2020-11-22 03:00

I\'m asking for a template trick to detect if a class has a specific member function of a given signature.

The problem is similar to the one cited here http://www.go

17条回答
  •  遇见更好的自我
    2020-11-22 03:33

    You can use std::is_member_function_pointer

    class A {
       public:
         void foo() {};
    }
    
     bool test = std::is_member_function_pointer::value;
    

提交回复
热议问题