(1) to define A class A
A f ()
{
A, A.
Return a;
}
A, b.
B=f ();
This time will automatically copy, if such A function definition in brackets are the object of the class, that is called?
As A f (c) this kind of situation,
CodePudding user response:
If there is no definition copy function, will generate the default copy functionCodePudding user response:
1. If there is no return value type belt & amp; , copy is invoked structure, best oneself write a test a try,In addition, belt & amp; Return values, must ensure that its life cycle at the end of the function exists, the
2. The above function parameters, without & amp; Called, is the value, will make a copy,