fork download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4.  
  5. int main() {
  6. struct dummy {
  7.  
  8. void one() {}
  9.  
  10. void two() & {}
  11.  
  12. void three() && {}
  13. };
  14.  
  15. std::cout << std::boolalpha;
  16. std::cout << std::is_member_function_pointer<decltype(&dummy::one)>::value << std::endl;
  17. std::cout << std::is_member_function_pointer<decltype(&dummy::two)>::value << std::endl;
  18. std::cout << std::is_member_function_pointer<decltype(&dummy::three)>::value << std::endl;
  19. }
  20.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
true
false
false