If I have a template function like
template<typename T>
void doSomething(const T arg) {.....}
then I do not know ahead of time if T is a simple int or if it is a huge struct. If it is an int, passing by value makes sense, while the struct should be passed by reference.
How do I design a template function which works sensibly with both types of argument?