One very significant piece of information you didn't mention in the video is that the reference of only those objects which are declared outside the scope of the function(passed to the function as a reference parameter or global object) or dynamically allocated objects declared inside the function, can have their references returned. In other words, only those objects which also exist outside the scope of the function, can have their references returned.