摘要: C++11起,引入了基于范围的for循环这一特性,有什么好处呢?它有时可以大大地简化遍历容器的操作,比如说STL的vector。 std::vector v{1, 2, 3}; std::vector<int>::iterator it = begin(v); for (; it != end(v) 阅读全文
posted @ 2023-11-07 21:36 ChebyshevTST 阅读(686) 评论(0) 推荐(1)