In the line you commented, there is no difference when using someClassA&
(reference) or someClassA
(copy)
A reference is an alias [1] (another name) for the same variable. So you don't pass a pointer, and you don't copy the variable, but you send the reference-to-the-variable. You can use the reference just like the variable itself, because it IS actually referencing the original variable.
The commented line isn't affected by this at all. However the copy constructor is called when you call:
obj_x = someClassA(obj_a); // here, obj_a is given to the (copy-)constructor of someClassA.
What you have is an assignment like @eerorika said.
You can specify a custom assignment operator operator=
and handle the action yourself.
More info about references/aliases and how they differ from pointers:
[1] Reference vs. pointer