I think the following is really basic but I don't really get what would be the "advantages" of one of these code.
Having this:
int main()
{
int a = 10;
f(a);
return 0;
}
What would be the difference between
void f(int& a)
{
int& b = a;
}
and
void f(int& a)
{
int b = a;
}
In particular, in the case where f would instead be the constructor of a class and where instead of an int we have a big object.
I would go with the second possibility... What do you think ?
Thanks.
Edit:
First, looking at the answers, I though I was brain dead when I posted the question, but actually I found interesting subquestions (and answers !) in the comments.