Why when you return object by reference you dont need to be worried that the reference will be destroyed?
===

you have the following:

    Person& getPersonByName(string name);

Why don’t you need to be worried that the return person from the getPersonByName will be destructed as soon as the method ended so the caller method will work on destructed data.

Thank you