Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我遇到的这段代码真的让我很困惑,它似乎利用右值语义来打印一个向量:
std::vector<int> b = {0,0,0,14,15,123,2431}; mergeAndSort(a,b); for(auto&& i : b) std::cout << i << ' ';
但我设置的是什么?为什么循环 b 需要一个右值引用?