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
Well, in your specific case (filling a container with values) I would go for an input iterator approach. But in all other cases (like a complicated string generation or some calculations) I wouldn't care about possible performance hits and trust RVO (see Jim's answer) and the compiler to optimize it like it should. If it becomes a bottleneck (profile!), change it of course!