I understand the principle point of references is to avoid making copies of large structures, but what if a function you\'re writing itself creates a large structure? Is it
My advice is to write the code so that the client usage is as intuitive as possible.
If - as is usually the case - you judge that to be returning by value, then if your system is performance critical and you find a particular return value is not being optimised nicely by your compiler - even at the highest reasonable optimisation level you can use and after checking for any relevant command line options or compiler tips on achieving RVO, and considering alternative compilers if practical - ideally a C++11 compiler that benefits from always-efficient move semantics, only then change the specific problematic spot to accept the return value by reference.