There is such code:
const int fun(){ return 2; } // can be assigned to int and const int
int fun2(){ return 2; } // can be assigned to int and const int
Is there any difference in using these functions? They both return by value so it is always copied at the end of function call.
No. There is, however, a difference in their type, and if the functions returned a class type, there would be difference regarding invoking methods on the return value.