I read that they are conceptually equal. In practice, is there any occasion that
foo(T t)
is preferred over
foo(const T&
If the most straightforward implementation of the function involves modifying the parameter value locally, then it makes sense to pass it by value rather than by const reference
For example, the one line version of strcpy:
char *strcpy(char *dest, const char *src)
{
while (*dest++ = *src++);
return s1;
}
If you took in the pointers as const references, you would need to copy them to temporaries in the body of your program, rather than letting the paramater passing mechanism do it for you.