I have been using this approach for returning references from functions in C++. However, I suspect that there is better patterns to perform operations like this. Also, I guess that this approach implies in memory leak.I have been using this approach for returning r