fork(1) download
  1. #include <iostream>
  2.  
  3. template<typename T>
  4. void print_double(T x)
  5. {
  6. std::cout << x * 2 << std::endl;
  7. }
  8.  
  9. void print_double(const std::string &) = delete;
  10.  
  11. int main()
  12. {
  13. print_double(2);
  14. print_double(3.14);
  15. print_double("Hello");
  16. }
  17.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of ‘void print_double(T) [with T = const char*]’:
prog.cpp:15:22:   required from here
prog.cpp:6:17: error: invalid operands of types ‘const char*’ and ‘int’ to binary ‘operator*’
  std::cout << x * 2 << std::endl;
               ~~^~~
stdout
Standard output is empty