In C++, is it still bad practice to return a vector from a function?

Dave Abrahams has a pretty comprehensive analysis of the speed of passing/returning values.

Short answer, if you need to return a value then return a value. Don’t use output references because the compiler does it anyway. Of course there are caveats, so you should read that article.

Leave a Comment