for(auto x : range) 创建拷贝,无法修改range中的元素
for(auto x : range)
for(auto& x : range)
for(auto&& x : range)
for(const auto & x : range)
C++ 遍历循环表达示 auto, auto&, auto&&
原文:https://www.cnblogs.com/yaos/p/12094304.html