template<typename T> void f(T&) { return; } int main(void) { f<const int>(5); f('c'); f(6.2); }
Standard input is empty
prog.cpp: In function 'int main()': prog.cpp:7:10: error: invalid initialization of non-const reference of type 'char&' from an rvalue of type 'char' prog.cpp:2:6: error: in passing argument 1 of 'void f(T&) [with T = char]' prog.cpp:8:10: error: invalid initialization of non-const reference of type 'double&' from an rvalue of type 'double' prog.cpp:2:6: error: in passing argument 1 of 'void f(T&) [with T = double]'
Standard output is empty