Does declaring something like the following
void foo(int x) { std::cout << \"foo(int)\" << std::endl; } void foo(const int &x)
You could do this with a template:
template void foo(T x) { ... }
Then you can call this template by value or by reference:
int x = 123; foo(x); // by value foo(x); // by refernce