fork download
  1. #include <string>
  2.  
  3. template <typename Callable>
  4. int fujitsu(Callable callable) {}
  5.  
  6. int main() {
  7. fujitsu(std::stoi);
  8. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:7:22: error: no matching function for call to 'fujitsu(<unresolved overloaded function type>)'
     fujitsu(std::stoi);
                      ^
prog.cpp:7:22: note: candidate is:
prog.cpp:4:5: note: template<class Callable> int fujitsu(Callable)
 int fujitsu(Callable callable) {}
     ^
prog.cpp:4:5: note:   template argument deduction/substitution failed:
prog.cpp:7:22: note:   couldn't deduce template parameter 'Callable'
     fujitsu(std::stoi);
                      ^
stdout
Standard output is empty