There are two different uses in this example auto&&, one visible, one hidden. To be as detailed as possible, the loop you have is expanding to:
{
auto&& __range = get_map();
auto __begin = __range.begin();
auto __end = __range.end();
for (; __begin != __end; ++__begin) {
auto&& __elem = *__begin;
std::string const& k = std::get<0>(__elem);
int const& v = std::get<1>(__elem);
std::cout << "k=" << k << " v=" << v << '\n';
}
}
Hence:
why is it normal to switch from temporary to repeated.
. map __range, , . .
, :
auto&& auto&, lvalue
. -, "" - - , , , , - . , auto&& auto&. , lvalue, auto&& auto& . rvalue, auto&& ( rvalue), auto& .