When not to use `auto&&`?
问题 auto&& mytup = std::make_tuple(9,1,"hello"); std::get<0>(mytup) = 42; cout << std::get<0>(mytup) << endl; Is there a copy/move involved (without RVO) when returning from make_tuple? Is it causing undefined behavior? I can both read write the universal reference. Can auto&& var = func() be used always instead of auto var = func() so that there is no copy/move? 回答1: Yes. Any return from a function that does not return a reference type may involve a copy/move. Eliding that is what RVO is about.