This is something that has been bothering me for a while.
Assume the following two class definitions:
class Inner {
int a;
int b;
...
};
class Outer {
Inner a;
int aa;
int bb;
};
Further assume that Outer's constructor takes an Inner object as an
argument. Keeping in mind that Outer contains its own Inner object
and not a reference to a 'foreign' Inner, should Outer's constructor
be:
Outer(Inner a) : a(a) {...}
OR
Outer(Inner& a) : a(a) {...}
?
I know they both have the same outcome, but I'm asking this question
from a performnce standpoint. Assume Inner is larger than four bytes.
Thanks.