Out Parameters, Move Semantics, and Stateful Algorithms -- Eric Niebler
In this article, Eric Niebler discusses an issue of API design regarding the age-old question of out parameters versus return-by-value, this time in light of move semantics. He uses std::getline as his example.
Out Parameters, Move Semantics, and Stateful Algorithms
by Eric Niebler
From the article:
I think
getlineis a curious example because what looks at first blush like a pure out parameter is, in fact, an in/out parameter; on the way in,getlineuses the passed-in buffer’s capacity to make it more efficient. This putsgetlineinto a large class of algorithms that work better when they have a chance to cache or precompute something.

Ready for a full day of C++11/14/17 content in the Spanish language?