fork download
  1. #include <iostream>
  2. using namespace std;
  3. template<class S> class Foo;
  4.  
  5. template<class Ret, class Arg, class... Args>
  6. class Foo<Ret(Arg*, Args...)>
  7. {
  8. public:
  9. template<class FUNC>
  10. Foo(FUNC func, int)
  11. {
  12. cout << "func" << endl;
  13. }
  14. template<class Rett>
  15. Foo(Rett(int::*method)(Args... args)) { cout << "fptr" << endl; }
  16.  
  17. };
  18.  
  19. int main()
  20. {
  21. return 0;
  22. }
  23.  
Compilation error #stdin compilation error #stdout 0s 3452KB
stdin
Standard input is empty
compilation info
prog.cpp:15:14: error: expected ')' before '::' token
  Foo(Rett(int::*method)(Args... args)) { cout << "fptr" << endl; }
              ^
prog.cpp:15:14: error: expected ',' or '...' before '::' token
prog.cpp:15:38: error: expected constructor, destructor, or type conversion before ')' token
  Foo(Rett(int::*method)(Args... args)) { cout << "fptr" << endl; }
                                      ^
stdout
Standard output is empty