My psychic powers tell me that you are compiling this in Visual C ++, so it even works. In standard C ++, you cannot pass rvalue (which is the return value makeRandomData) to a non-const reference, so the question is debatable.
, mean, const vector<int>&. , , " ", . - results. - .
, RVO, , , RVO - , . ( ) RVO , . , -, , .