fork download
  1. #include<set>
  2.  
  3. template<typename X, typename = void>
  4. struct A
  5. {
  6. std::pair<X,bool> foo (const X& i) { return std::pair<X,bool>(X(),true); } // choice
  7. void foo (std::initializer_list<X> i) { return 0; }
  8. };
  9.  
  10. template<typename Any, typename T>
  11. T ReceiveFuncPtr (Any (T::*Method)(const int&))
  12. {
  13. T obj;
  14. (obj.*Method)(1);
  15. return obj;
  16. }
  17.  
  18. int main ()
  19. {
  20. ReceiveFuncPtr(&A<int>::foo); // OK
  21. }
  22.  
Success #stdin #stdout 0s 3136KB
stdin
Standard input is empty
stdout
Standard output is empty