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::deque使用“增强的 for 循环”:
std::deque
int a[] = { 0, 1, 2, 3, 4, 5 }; std::deque<int> dq(a, a+6); for(auto i : dq) std::cout << i << ", ";
对于给定的 STL 容器,“增强的 for 循环”的正确语法(如果可能)是什么?