I have a function that looks like this:
// Fetch 1 MB of data
void GetData(std::vector<char> & outData);
The 1MB is exaggerated, but I just want to make the point that it's preferable to avoid unnecessary copies.
If I add this overload:
std::vector<char> GetData()
{
std::vector<char> result;
GetData(result);
return result;
}
Then how likely is it that RVO will kick in?