C++ is difficult...T_T
- Choose auto x when you want to work with copies.
- Choose auto &x when you want to work with original items and may modify them.
- Choose auto const &x when you want to work with original items and will not modify them.
- Use auto && is a Universal Reference.
https://stackoverflow.com/questions/29859796/c-auto-vs-auto
https://zhuanlan.zhihu.com/p/25148592
2018/11/06 Updated
I found this and explained very detail.
http://tommyjswu-blog.logdown.com/posts/1766009-c-11-mouth-cannon-universal-reference-rvalue-reference-and-move-semantics