// Scenario 1: A¬hing(A a)
Constructor Called! // aa is created
Constructor Called! // bb is created
Copy Called! // a is created as a copy of aa
Destructor Called! // a is destroyed
Assignment Called! // a is assigned to bb (NOT SAFE! a HAS ALREADY BEEN DESTROYED)
Destructor Called! // bb is destroyed
Destructor Called! // aa is destroyed
// Scenario 2: A¬hing(A&a)
Constructor Called! // aa is created
Constructor Called! // bb is created
Assignment Called! // aa is assigned to bb
Destructor Called! // bb is destroyed
Destructor Called! // aa is destroyed
// Scenario 3: A nothing(A&a)
Constructor Called! // aa is created
Constructor Called! // bb is created
Copy Called! // The return value is created as a copy of aa (referred to by a)
Assignment Called! // The return value is assigned to bb
Destructor Called! // The return value is destroyed
Destructor Called! // bb is destroyed
Destructor Called! // aa is destroyed
// Scenario 4: A nothing(A a)
Constructor Called! // aa is created
Constructor Called! // bb is created
Copy Called! // a is created as a copy of aa
Copy Called! // The return value is created as a copy of a
Destructor Called! // a is destroyed
Assignment Called! // The return value is assigned to bb
Destructor Called! // The return value is destroyed
Destructor Called! // bb is destroyed
Destructor Called! // aa is destroyed