#include <iostream> template<typename T>void print_double(T x){ std::cout << x * 2 << std::endl;} void print_double(const std::string &) = delete; int main(){ print_double(2); print_double(3.14); print_double("Hello");}
Standard input is empty
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; ~~^~~
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!