Why is the output of this code :
#include template void f(T param) { std::cout << \"General\" << std::e
A reference is just an alias, not a type. So when you call f(z), it matches the first version with T=int, which is a better option that T=int&. If you change T to T&, then both int and int& arguments will call the second version.