fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. template <typename T>
  6. void foo(T&& x) { x.func(); }
  7.  
  8. int main()
  9. {
  10. auto bar = &foo<int>;
  11. }
Compilation error #stdin compilation error #stdout 0s 3456KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of 'void foo(T&&) [with T = int]':
prog.cpp:10:14:   required from here
prog.cpp:6:19: error: request for member 'func' in 'x', which is of non-class type 'int'
 void foo(T&& x) { x.func(); }
                   ^
stdout
Standard output is empty